1
0
Fork
You've already forked apod
0
Scraping stars.
  • Perl 100%
2025年08月26日 21:06:45 -04:00
apod cleanup 2025年08月26日 21:06:45 -04:00
LICENSE add license 2025年06月30日 22:39:58 -04:00
README.md update readme 2025年08月18日 21:20:26 -04:00

apod

A script to download the Astronomy Picture of the Day (APOD).

Usage

usage: apod [-h] [-v] [-a] [-d DIR] [NAME]
Download the Astronomy Picture of the Day (APOD).
Arguments:
 NAME Alternative filename for the downloaded image. This
 option will not apply when archiving.
Options:
 -a, --archive Download the entire APOD archive
 -d, --directory DIR Download the image or archive to DIR
 -v, --verbose Report when an image is downloaded
 -h, --help Display this help message and quit

By default, apod will download the current APOD and save it in your working directory using the extracted filename. If you specify an alternative filename for the downloaded image, apod will automatically extract and append the file extension for you. This argument does not apply when downloading the entire APOD archive.

The following example is a cron job that will download the daily APOD and save it to the directory /storage/apods/ with the current date:

0 3 * * * /path/to/apod -d "/storage/apods" "$(date '+%Y-%m-%d')"

Requirements

The script relies on the following Perl libraries, which can be installed via CPAN or your system's package manager:

# Using CPAN.
perl -MCPAN -e 'install HTML::LinkExtractor; install HTML::TokeParser; install Path::Tiny'
# Using `apt` on Debian.
apt install -y libhtml-linkextractor-perl libpath-tiny-perl