Giter Club home page Giter Club logo

app-apotd's Introduction

Actions Status

TITLE

Astronomy Picture of the Day

SUBTITLE

Download Today's Astronomy Picture of the Day

VERSION

This documentation refers to apotd version 1.0.9

USAGE

apotd [-v|-V|--version] [--verbose]
apotd [-d|--dir=<Str>] [-f|--filename=<Str>] [-a|--prepend-count]

  -d|--dir=<Str>         What directory should the image be saved to? [default: '$*HOME/Pictures/apotd']
  -f|--filename=<Str>    What filename should it be saved under? [default: the caption of the image]
  -a|--prepend-count     Add a count to the start of the filename. [default: False]

To downloand the image and save it using the default behavior, simply:

$ apotd

DESCRIPTION

Astronomy Picture of the Day is a website provided by NASA and Michigan Technological University which provides a different astronomy picture every day.

Each day a different image or photograph of our fascinating universe is

featured, along with a brief explanation written by a professional astronomer.

Set apotd as a cronjob (*nux), launch agent (MacOS), or Task Scheduler (Windows) and you'll accumulate a beautiful collection of images for wallpaper, screen savers, etc.

SYNOPSIS

By default, apotd will save to

~/Pictures/apotd/

with the filename taken from the caption of the photo e.g.

Dark Nebulae and Star Formation in Taurus.jpg

and will optionally prepend a number which increments with each new image, e.g.

2483-Dark Nebulae and Star Formation in Taurus.jpg

Macintosh allows a comment to be associated with each file. So on Macs, apodt will copy the alt text and the permalink for the image into the file's comment, e.g.

A star field strewn with bunches of brown dust is pictured. In the center is a bright area of light brown dust, and in the center of that is a bright region of star formation.

https://apod.nasa.gov/apod/ap230321.html

OPTIONS

# Save to directory "foo"
$ apotd --dir=foo
$ apotd    -d=foo

# Save with the filename "bar"
# The image's extension, e.g. ".jpg", will be automatically added.
$ apotd --file=bar
$ apotd     -f=bar

# Prepend a count to the filename
$ apotd --prepend-count
$ apotd  -p

DIAGNOSTICS

General problems

Failed to get the directory contents of <directory>: Failed to open dir: No such file or directory

Failed to create directory <directory>: Failed to mkdir: No such file or directory

Failed to resolve host name 'apod.nasa.gov'

Problems specific to apotd

Couldn't find an image on the site. It's probably a video today.

The image has already been saved as <filename>.

Couldn't write the alt-text to <path>.

Success

Successfully wrote Pictures/apotd/ 2483-Dark Nebulae and Star Formation in Taurus.jpg

Successfully wrote the alt-text and permanent link as a comment to the file.

DEPENDENCIES

LWP::Simple;
Filetype::Magic;
Digest::SHA1::Native;

ASSUMPTIONS

apotd assumes that the caption of the photo is the first <b> ... </b> line in the HTML code.

And that the image is the first <IMG SRC= html tag.

And that tag has an alt= attribute.

BUGS AND LIMITATIONS

There are no known bugs in this module.

AUTHOR

Shimon Bollinger [email protected]

Source can be located at: https://github.com/deoac/apotd.git

Comments, suggestions, and pull requests are welcome.

LICENSE AND COPYRIGHT

© 2023 Shimon Bollinger

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

app-apotd's People

Contributors

deoac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.