NOTE: Not meant for external use, but still open-source for those interested.
This script automatically updates the SAIG calendar based on our shared google calendar.
- Sets up GitHub API authentication and fetches the latest calendar.json file from the SAIG website repo.
- Sets up Google Calendar API auth and fetches the latest calendar data.
- Formats latest calendar data to only what we need.
- Compare old and new data to see if changes exist.
- Use the GitHub API to update (push a commit) the calendar.json file if we find changes.
- Our netlify app hosting the website notices the new commit and automatically rebuilds the website with the new data.
The app is hosted on heroku, where we do a check every 10 min for changes to the calendar.
Cheers to automation! 🎉