Get a Telegram message when a new slot appears on the public Foodsharing Zürich “Einführungsabholungen” (EinAb) Google Sheet—without checking the sheet yourself.
By default it notifies when a row’s Status contains frei (configurable).
- A Telegram account
- A GitHub account (for the scheduled workflow)
- Open Telegram and talk to @BotFather.
- Send
/newbotand follow the prompts. - Copy the HTTP API token BotFather gives you. That value is your
TELEGRAM_BOT_TOKEN.
The bot must be allowed to message you (or a group you add it to). Your numeric ID is TELEGRAM_CHAT_ID.
Easy approach: message @userinfobot or @getidsbot and copy your user ID.
Alternative: start a chat with your new bot, send any message, then open this URL in a browser (replace YOUR_BOT_TOKEN):
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
Look for "chat":{"id": …} and use that number (including a leading minus if it is a group).
- Fork this repository to your GitHub account, or
- Use “Use this template” / copy the files into a new repo.
In your repo: Settings → Secrets and variables → Actions → New repository secret
| Name | Value |
|---|---|
TELEGRAM_BOT_TOKEN |
Token from BotFather |
TELEGRAM_CHAT_ID |
Your chat ID (digits, or negative for a group) |
- Open the Actions tab and enable workflows if GitHub asks.
- The workflow EinAb Poller runs every 5 minutes and updates
state.jsonin the repo when something changes (so each run knows what was already notified).
On the first successful run after a fresh state.json, the script records existing frei rows and does not send messages. After that, new matching rows trigger Telegram notifications.
If you forked a copy that already had a populated state.json, replace it with the bootstrap version from this repo (empty notified_keys, bootstrapped: false) so your first run matches a clean setup.
- Downloads the sheet as CSV (public export URL).
- Keeps rows whose status matches your
NOTIFY_STATUSlist. - Compares with hashes stored in
state.jsonand notifies only on new rows. - Sends messages via the Telegram Bot API.
- Never commit real
TELEGRAM_BOT_TOKENorTELEGRAM_CHAT_IDvalues into the repo. Use GitHub Actions secrets only. - The workflow needs
contents: writeso it can commitstate.json(required for remembering state between runs). - The default Google Sheet is public; this tool only reads its published CSV.
This project is licensed under the MIT License.