apod-downloader

A simple script to download the NASA's Astronomy Picture of the Day from https://apod.nasa.gov

View the Project on GitHub julianogiusti/apod-downloader

APOD downloader

A simple script/API to download the NASA’s Astronomy Picture of the Day.

This script was written using Python and Flask to download the picture and set it as wallpapers on ubuntu 18.04 with gnome.

Using it

Install requirements:

$ pip install -r requirements.txt

Run the Flask app:

$ python apod.py

You can now call the API in http://127.0.0.1:5000/apod, choosing a date or “random” to get one date from 1995-06-16 to today:

$ curl -X GET http://127.0.0.1:5000/apod/2019-05-21
$ curl -X GET http://127.0.0.1:5000/apod/random

If you don’t choose a date, the current day is chosen by default.

$ curl -X GET http://127.0.0.1:5000/apod

To use the functionality to download and set wallpaper on Ubuntu, you can use the /apod_wallpaper endpoint:

$ curl -X GET http://127.0.0.1:5000/apod_wallpaper
$ curl -X GET http://127.0.0.1:5000/apod_wallpaper/2019-05-21
$ curl -X GET http://127.0.0.1:5000/apod_wallpaper/random

References and sources: