aboutsummaryrefslogtreecommitdiff
path: root/README.org
blob: 70490d629322e15651a6f682e29c8a0c3d16f44f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
This script screen scrapes data from the latest [[https://apod.nasa.gov/][NASA Astronomy Picture
of the Day (APOD)]] and posts it to a specified [[https://gnu.io/social/][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.

#+BEGIN_EXAMPLE
0 12 * * * /path/to/apod-bot.sh
#+END_EXAMPLE

I run this bot in my GNU Social instance at
[[https://social.systemreboot.net/apod][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:

#+BEGIN_SRC bash
  #! /usr/bin/bash -xefu
#+END_SRC

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.