A fork of LauPaSat-pl/TGTG notifications, and inspired by Der-Henning/tgtg and kacpi2442/am_bot
This runs 100% automatically on Github actions (not counting the set up), to check for your favourite TooGoodToGo bags and send you a Telegram message about it.
- Create a new Telegram bot using BotFather tutorial,
- Check your Telegram ID tutorial,
- Install the
tgtg
Python library
pip install tgtg
- Run
from tgtg import TgtgClient
client = TgtgClient(email="<your_email>")
credentials = client.get_credentials()
You should receive an email from TooGoodToGo. The client will wait until you validate the login by clicking the link inside the email.
Once you clicked the link, you will get credentials and be able to use them
print(credentials)
{
'access_token': '<your_access_token>',
'refresh_token': '<your_refresh_token>',
'user_id': '<your_user_id>',
'cookie': '<cookie>',
}
- Fork this repo,
- In your repo add secrets (tutorial) you got from earlier steps (TooGoodToGo and Telegram), you can check how to name them in
notitications.yml
file, - Make sure it's up and running. (It's ok, if at least one of the TG³ notifications badges at the top is green)