You are browsing as a guest. Sign up (or log in) to start making projects!

Cosmo!

  • 4 Devlogs
  • 3 Total hours

Cosmo-bot brings cat facts, jokes, NASA's Astronomy Picture of the Day, and more right into your Slack workspace via slash commands. And it replies to messages 24/7!

Open comments for this post

1h 10m 32s logged

Cosmo is now Running 24/7!

Today I successfully deployed Cosmo on Nest.
Previously, I have to keep my laptop open and a the program just keeps runnig to keep the bot alive.
It was hosted on Nest, Cosmo runs 24/7 in the cloud.
It is completely independent of my laptop, always online and ready to respond to slash commands in the slack workspace anytime even when I am sleeping

  • Cloned my project on remote linux server on nest.
  • Achived 24/7 working so it never misses a command
  • No more loacl hosting problems

Cosmo is now Running 24/7!

Today I successfully deployed Cosmo on Nest.
Previously, I have to keep my laptop open and a the program just keeps runnig to keep the bot alive.
It was hosted on Nest, Cosmo runs 24/7 in the cloud.
It is completely independent of my laptop, always online and ready to respond to slash commands in the slack workspace anytime even when I am sleeping

  • Cloned my project on remote linux server on nest.
  • Achived 24/7 working so it never misses a command
  • No more loacl hosting problems

Replying to @vedasm

1
4
Open comments for this post

42m 58s logged

Orbit Tracker /csb-orbit

This feature lets users see exactly how many humans are currently orbiting the earth with their names and spacecraft.

  1. When the user runs this command the bot makes the request to Open-Notify Astros API.

  2. Then API gives the JSON data containing no. of Astronauts in array of objects with each persons spacecraft.

  3. And the bot give the result in the chat.

Orbit Tracker /csb-orbit

This feature lets users see exactly how many humans are currently orbiting the earth with their names and spacecraft.

  1. When the user runs this command the bot makes the request to Open-Notify Astros API.

  2. Then API gives the JSON data containing no. of Astronauts in array of objects with each persons spacecraft.

  3. And the bot give the result in the chat.

Replying to @vedasm

1
12
Ship #1 Pending review

🚀 Cosmo Bot has been delivered!
I built Cosmo! A slack bot that wants to bring a little utility, space exploration and a little humour into your workspace.

Here's what I made: A fully functional Slack bot with a variety of unique slash commands like /csb-ping to check latency, /csb-catfact and /csb-joke for some quick laughs and /csb-apod to grab the Astronomy Picture of the Day from NASA.

The Challenge: Figuring out how to elegantly handle external JSON payloads, and how to format Slack's Block Kit to make rich media (like NASA's daily images, titles, and descriptions) look beautiful inside of a channel.

Things I’m proud of: Deploying the bot on Nest so it runs 24/7, which means it’s always live and ready to go even when my laptop is closed! 🌌✨

Try project → See source code →
Open comments for this post

16m 58s logged

🚀 Cosmo Bot Update: New Commands & Core Features

I have been spending a lot of time trying to make Cosmo feel like an actual interactive, instead of just blank script. I finally got a bunch of custom slash commands working in my Slack workspace, but man, getting here was a bit of a headache.

🛠️ What was built

  • /csb-ping - Just simple command to check the latency of bot response. Used to make sure the bot is working and not crashed.
  • /csb-catfact & /csb-joke - I have added these for a bit random fun. It just instantly give you a cat-fact and a joke.
  • /csb-apod - This was the biggest task to code but it is easily one of coolest feature. It pings NASA’s Astronomy Picture of the Day API and give you Title, Image and Description of APOD.

At first, dealing with external JSON payloads was a mess. I kept hitting API errors trying to parse NASA’s response. I had to figure out how to manually dig into the JSON, extract the exact image URL, title, and description, and then map it into JavaScript. As NASA send it’s API data little slowly if many accessed at same time. So I add a wait period of 3s. So if it get the repose it displays it, if it throws a fails to fetch.

🚀 Cosmo Bot Update: New Commands & Core Features

I have been spending a lot of time trying to make Cosmo feel like an actual interactive, instead of just blank script. I finally got a bunch of custom slash commands working in my Slack workspace, but man, getting here was a bit of a headache.

🛠️ What was built

  • /csb-ping - Just simple command to check the latency of bot response. Used to make sure the bot is working and not crashed.
  • /csb-catfact & /csb-joke - I have added these for a bit random fun. It just instantly give you a cat-fact and a joke.
  • /csb-apod - This was the biggest task to code but it is easily one of coolest feature. It pings NASA’s Astronomy Picture of the Day API and give you Title, Image and Description of APOD.

At first, dealing with external JSON payloads was a mess. I kept hitting API errors trying to parse NASA’s response. I had to figure out how to manually dig into the JSON, extract the exact image URL, title, and description, and then map it into JavaScript. As NASA send it’s API data little slowly if many accessed at same time. So I add a wait period of 3s. So if it get the repose it displays it, if it throws a fails to fetch.

Replying to @vedasm

1
50
Open comments for this post

29m 27s logged

Today I spend my day by adding a new feature /csb-apd.

It’s basically a slash commond the calls NASA’s Astronomy Picture of the Day API and brings the data over to Slack. It sounds simple while hearing it. But getting data from external JSON and displaying the image is real trial and error. I had extract the image URL , title and description from NASA’s response. Then map them into the js for the slash command /csb-apd reference and sent it as nice media card.

Seeing the Pluto image finally render perfectly in the channel after hitting a few api errors was a massive win. Greatfully learned about API and there usability and integration in to any system or projects.

Today I spend my day by adding a new feature /csb-apd.

It’s basically a slash commond the calls NASA’s Astronomy Picture of the Day API and brings the data over to Slack. It sounds simple while hearing it. But getting data from external JSON and displaying the image is real trial and error. I had extract the image URL , title and description from NASA’s response. Then map them into the js for the slash command /csb-apd reference and sent it as nice media card.

Seeing the Pluto image finally render perfectly in the channel after hitting a few api errors was a massive win. Greatfully learned about API and there usability and integration in to any system or projects.

Replying to @vedasm

1
22

Followers

Loading…