Skip to content
/ apod Public

Drupal 9/10 module that implements the NASA Image of the Day API.

License

Notifications You must be signed in to change notification settings

r0nn1ef/apod

Repository files navigation

❗ 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.

NASA Astronomy Picture of the Day

Provides a page and block with NASA's Astronomy Image of the Day.

Purpose

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.

Installing using Composer

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

Suggested Configuration

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

Usage

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.

TODO

Refactor to use dependency injection for services, routes, and blocks.

About

Drupal 9/10 module that implements the NASA Image of the Day API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published