Scraping stars.
- Perl 100%
| apod | cleanup | |
| LICENSE | add license | |
| README.md | update readme | |
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