1.6 KiB
1.6 KiB
caFICtería-aaS (bot)
This is the bot that actually scrapes the menus from Telegram and puts them in a JSON file.
⚙️ Usage
get_history.py
will download all messages on the channel and parse them (2018-now). Should be run when you install everything (I guess you can skip this if you don't love data 😔).- This will also include the menus sent in photos during a few days in July 2022 (manually parsed in
menu_photos_history.json
).
- This will also include the menus sent in photos during a few days in July 2022 (manually parsed in
bot_listen.py
will listen for new messages on the channel, and parse them when received. This is what should be running to fetch the messages received after the initial run ofget_history.py
.
🔧 Environment Variables
Name | Required | Description |
---|---|---|
TG_API_ID |
YES | Your telegram API Id |
TG_API_HASH |
YES | Your telegram API Hash |
TG_SESSION_NAME |
NO | The telethon session name/path (Default: "default") |
TG_CHANNEL_NAME |
NO | The channel where the menu info is stored (Default: "CafeteriaFIC") |
MENU_HISTORY_FILE_PATH |
NO | The place where the JSON file with the menu history will be stored. (Default: "/tmp/menu_history.json") |
Tip💡: Look at Telethon documentation for info about the telegram authentication process
🐳 Building the Docker image
git clone https://git.peprolinbot.com/peprolinbot/caFICteria-aaS.git
cd caFICteria-aaS/bot
docker build -t caficteria-bot .