caFICteria-aaS/bot
2025-02-10 13:31:47 +01:00
..
.dockerignore Initial commit 2024-12-02 18:40:31 +01:00
bot_listen.py Use channel id instead of name 2025-02-10 13:31:47 +01:00
config.py Use channel id instead of name 2025-02-10 13:31:47 +01:00
Dockerfile Initial commit 2024-12-02 18:40:31 +01:00
get_history.py Initial commit 2024-12-02 18:40:31 +01:00
menu_photos_history.json Initial commit 2024-12-02 18:40:31 +01:00
README.md Use channel id instead of name 2025-02-10 13:31:47 +01:00
requirements.txt Initial commit 2024-12-02 18:40:31 +01:00
utils.py Initial commit 2024-12-02 18:40:31 +01:00

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).
  • 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 of get_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_ID NO The channel where the menu info is stored (Default: -1001385379004 (id of https://t.me/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 .