This bot monitors OLX for new apartment listings in Krakow and notifies users via Telegram. It now uses the OLX API for data retrieval and includes enhanced features for a better user experience.
/start
- Start the bot and show the main menu./menu
- Display the main command menu./help
- Show available commands./setprice
- Set the price range./addlocation
- Add a district to search./removelocation
- Remove a district from the search./getfilters
- Show current filters./resetfilters
- Reset all filters to default./search
- Start searching for new listings./stop
- Stop searching for new listings.Clone the repository:
git clone https://github.com/oukmzli/olx-telegram-bot.git
cd olx-telegram-bot
Install dependencies:
pip install -r requirements.txt
Create a .env
file and add your Telegram bot token:
echo "TELEGRAM_BOT_TOKEN=your_bot_token_here" > .env
Run the bot:
python bot.py
Build the Docker image:
docker build -t olx-telegram-bot .
Run the Docker container with database volume and environment variable:
docker run -d \
--name olx-bot \
--env TELEGRAM_BOT_TOKEN=your_bot_token_here \
-v /path/on/host/listings.db:/app/listings.db \
olx-telegram-bot
Replace /path/on/host/listings.db with the actual path on your host machine where you want to store the database.
Ensure that when running the Docker container, you pass the TELEGRAM_BOT_TOKEN via the --env flag as per your instructions.
olx-telegram-bot/ ├── bot.py ├── db.py ├── olx_scraper.py ├── districts.py ├── requirements.txt ├── .gitignore ├── Dockerfile ├── .env (not included in version control) └── README.md