aboutsummaryrefslogtreecommitdiff

This script screen scrapes data from the latest NASA Astronomy Picture of the Day (APOD) and posts it to a specified GNU Social account. Run daily with a cron job, this script can be used as a bot that regularly reposts NASA APOD images to GNU Social. For example, to schedule the bot to run every day at 1200 hours, you would use the following crontab.

0 12 * * * /path/to/apod-bot.sh

I run this bot in my GNU Social instance at https://social.systemreboot.net/apod. Feel free to subscribe, or run the bot on your own in your GNU Social instance.

Troubleshooting tip

If you're having difficulty getting the script to work, it might help to add -x to the shebang, like this:

#! /usr/bin/bash -xefu

This makes bash print out the commands it is executing, and might help you figure out what's going wrong.

License

The source code is in the public domain.