Do you ever buy something, only to find later that you had a discount for it?
This Python project is a Telegram bot that scrapes various sources for discounts and provides them to users on command.
The project consists of two main components:
- A discount updater script (
main_discount_updater.py
) - The Telegram bot itself (
main_telegram_bot.py
)
- Clone the repository
- Install the required dependencies
pip install -r requirements.txt
- Setup your telegram bot with the Bot Father
- Copy
bot_template.yaml
tobot.yaml
and modify theTOKEN
andCHAT_ID
values inbot.yaml
- If something goes wrong while collecting the discount from the sources, a message will be sent to that chat.
- If you don't want to be notified, simply remove
CHAT_ID
frombot.yaml
- If you're on Linux, install the ChromeDriver driver with
sudo apt install chromium-chromedriver
Run the discount updater script to scrape discount information from the sources and generate a file with the results.
python main_discount_updater.py
You can set up a cronjob to run this script at regular intervals to keep the discount information up-to-date.
Run the Telegram bot to provide users with discount information fetched from the generated file.
python main_telegram_bot.py
The bot responds to the following commands:
/search
: Search for specific discounts
/all
: Retrieve all available discounts
Feel free to contribute to the project by adding other sources of discount information.