Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/githubocto/flat-demo-nasa-photo-of-the-day

A Flat Data GitHub Action demo repo
https://github.com/githubocto/flat-demo-nasa-photo-of-the-day

demo flat flat-data spaceship

Last synced: 1 day ago
JSON representation

A Flat Data GitHub Action demo repo

Awesome Lists containing this project

README

        

# Flat Data Demo: NASA Image of the Day

This demo is part of a larger Flat Data project created by [GitHub OCTO](https://octo.github.com/). Read more about the project [here](https://octo.github.com/projects/flat-data).

## What this demo does

This repository uses a [Flat Data Action](https://github.com/githubocto/flat) to fetch a JSON file with information about [NASA's image of the day](https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY) every day at 8 am UTC. Using a postprocessing script, Flat grabs the image URL within the JSON data and downloads the image as well.

Inside `.github/workflows/flat.yaml`:
```yaml
- name: Fetch data
uses: githubocto/flat@v3
with:
http_url: https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY # The data to fetch every day
downloaded_filename: data.json # The http_url gets saved and renamed in our repository as data.json
postprocess: postprocess.ts # A postprocessing javascript or typescript file written in Deno
```

diagram

## Postprocessing

Refer to the [Flat postprocessing library](https://github.com/githubocto/flat-postprocessing) for more helper functions and examples for writing postprocessing scripts.

## License

[MIT](LICENSE)