❗ The functionality in this repository has been merged with the NASA Astronomy Picture of the Day module on Drupal.org and is no longer maintained here. |
---|
Provides a page and block with NASA's Astronomy Image of the Day.
This module was designed as a training tool for learning the Drupal 8 API's and has been updated to support Drupal ^9.5 and ^10.
To install this module using composer, you will first need to add this repository to your composer.json
file. In the repositories section of your composer.json file, add the following:
{ "type": "vcs", "url": "[email protected]:r0nn1ef/apod.git" }
Once you add the repository, you can install the module as normal using the following to get the latest release:
composer require r0nn1ef/apod:^2.0
NASA does not require an API key to use the API associated with this module. However, without an API key, rate limiting calls will be introduced. To apply for an key, visit https://api.nasa.gov/index.html#apply-for-an-api-key.
Once you have received your API key, log in to your website and browse to Administration » Configuration » Web Services » Astronomy Picture of the Day Settings
Once enabled, you will be able to use the following features:
- There will be a block named "Astronomy Picture of the Day Block" under Structure » Block Layout. You can add this block as you would any other Drupal Block.
- The full sized image can be accessed by going to {site_url}/astronomy-picture-of-the-day or {site_url}/astronomy-picture-of-the-day/{date} where {date} is any valid date either in the YYYY-MM-DD format or a UNIX timestamp.
Refactor to use dependency injection for services, routes, and blocks.