APOD-slack
- 5 Devlogs
- 4 Total hours
a slack bot that posts pictures from NASA's Astronomy Picture Of the Day service.
a slack bot that posts pictures from NASA's Astronomy Picture Of the Day service.
caching! right now we have a 5 minute TTL, which is often enough to catch new pictures quickly but slow enough to stay (well) within ratelimits. also enrolled channels will receive their daily photo at 12 noon in the America/New_York timezone. also also it will retry api requests if they fail cuz the APOD api is kinda sketchy…..
now whenever someone runs /apod they get a (empheral) prompt to enroll the channel so it gets pictures daily. this adds the channel id to a SQLite table. there’s also a option to not be prompted to do this again. right now enrolling a channel doesn’t actually result in getting pictures daily, but i’m planning on using node-cron to set that up.
the bot now replies to the message with the explanation as posted by nasa.
now when you run /apod (or ping the bot) you get todays APOD. it also has the title of the picture and a button to open the full res version in your browser
Basic slackbot setup. Now when you run /apod or ping the bot user it’ll respond with a picture from lorum picsum.