Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blarc/advent-of-code-google-chat
Script for sending Advent of Code leaderboard information to Google Chat space.
https://github.com/blarc/advent-of-code-google-chat
advent-of-code github-actions github-template google-chat
Last synced: 8 days ago
JSON representation
Script for sending Advent of Code leaderboard information to Google Chat space.
- Host: GitHub
- URL: https://github.com/blarc/advent-of-code-google-chat
- Owner: Blarc
- Created: 2022-12-03T17:23:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T19:19:37.000Z (24 days ago)
- Last Synced: 2025-01-23T02:01:35.368Z (15 days ago)
- Topics: advent-of-code, github-actions, github-template, google-chat
- Language: Go
- Homepage:
- Size: 1.69 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent of Code Google Chat
This script sends Advent of Code leaderboard information to a Google Chat space.
## How it works
The script saves the current leaderboard in a `saved.json` file on GitHub. Every 15 minutes, the script uses the Advent of Code API to retrieve the updated leaderboard.
If the leaderboard has changed, the script saves the updated leaderboard to GitHub and sends a message with the updated leaderboard to the Google Chat space.## Getting started
To use this script, click the `Use this template` button and set up the required GitHub environment variables.
You can set up the environment variables by going to the `⚙️ Settings > Secrets` section of your project repository.## Setting environment variables
Before running the script, you need to set the following environment variables:```bash
export sessionCookie="YOUR_SESSION_COOKIE"
export googleChatUrl="YOUR_GOOGLE_CHAT_URL"
export leaderboardUrl="YOUR_LEADERBOARD_URL"
```
- `sessionCookie` can be retrieved by visiting the Advent of Code page and using your browser's developer tools to inspect the cookies associated with the page.- `googleChatUrl` should look something like https://chat.googleapis.com/v1/spaces/AAAAoYQLvw0/messages?key=YOUR_KEY&token=YOUR_TOKEN. You can get it from the Google Chat space by following the instructions [here](https://developers.google.com/chat/how-tos/webhooks#create_a_webhook).
- `leaderboardUrl` can be retrieved from the Advent of Code private leaderboard view, by clicking on `[API]` and then `[JSON]`.
## Running the script
Once you have set the environment variables, you can run the script using the following command:```bash
go run aoc.go
```