Skip to content
Magic Mirror Module displaying the last Astronomy Picture Of the Day (APOD) and using NASA API
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Module: MMM-APOD

This module displays the last Astronomy Picture Of the Day (APOD), including media (image or video), title, description and copyright.

The max-height and max-width of the media can be fixed and title and description display may be enabled or disabled independently.

MMM-APOD Screenshot #1 MMM-APOD Screenshot #2 MMM-APOD Screenshot #3

MagicMirror Project on Github | APOD on NASA

Installation:

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/grenagit/MMM-APOD

Configure the module in your config.js file.

Configuration:

Basic configuration

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: "MMM-APOD",
		position: "top_left",
		config: {
			appid: "abcde12345abcde12345abcde12345ab" // NASA API key (api.nasa.gov)
		}
	}
]

You can use the special DEMO_KEY api key for your tests but it has much lower rate limits !

Options

The following properties can be configured:

Option Description
appid The NASA API key, which can be obtained by signing up on NASA API portal. It's free!

This value is REQUIRED
updateInterval How often does the content needs to be fetched? (Milliseconds)

Possible values: 1000 - 86400000
Default value: 6 * 60 * 60 * 1000 (6 hours)
animationSpeed Speed of the update animation. (Milliseconds)

Possible values:0 - 5000
Default value: 1000 (1 second)
maxMediaWidth Maximum width for media display. If set to 0, the media's actual width is used. (Pixels)

Possible values:0 - 5000
Default value: 0 (media's width)
maxMediaHeight Maximum height for media display. If set to 0, the media's actual height is used. (Pixels)

Possible values:0 - 5000
Default value: 0 (media's height)
showTitle Show the title

Possible values: true or false
Default value: true
showDescription Show the description

Possible values: true or false
Default value: false
initialLoadDelay The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds)

Possible values: 1000 - 5000
Default value: 0
retryDelay The delay before retrying after a request failure. (Milliseconds)

Possible values: 1000 - 60000
Default value: 2500
apiBase The NASA API base URL.

Default value: 'https://api.nasa.gov/'
apodEndpoint The APOD API endPoint.

Default value: 'planetary/apod'

Todo

  • Create a function to summarize the description

License

This module is licensed under the MIT License

You can’t perform that action at this time.