githubocto / flat-demo-NASA-photo-of-the-day

A Flat Data GitHub Action demo repo

Home Page:https://octo.github.com/projects/flat-data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flat Data Demo: NASA Image of the Day

This demo is part of a larger Flat Data project created by GitHub OCTO. Read more about the project here.

What this demo does

This repository uses a Flat Data Action to fetch a JSON file with information about NASA's image of the day 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:

- 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 for more helper functions and examples for writing postprocessing scripts.

License

MIT

About

A Flat Data GitHub Action demo repo

https://octo.github.com/projects/flat-data

License:MIT License


Languages

Language:TypeScript 100.0%