Get notified instantly of new listings on OLX with this Python app that sends alerts via Telegram and email.
Before running the app, you must have the following installed:
- Python 3.x
- A Gmail account and a Gmail app password (see below how to get one)
- A Telegram bot (see below how to create one)
-
Clone/download this repository to your local machine.
-
Open a terminal and navigate to the project directory.
-
Create a new virtual environment by running the following command:
python3 -m venv venv
-
Activate the virtual environment:
source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Setup your Telegram bot:
- Create a new bot by talking to the BotFather.
- Copy the bot token.
- Send a message to your bot and get the chat ID.
- Copy the chat ID.
- Create a file named
.env
in the project directory. - Add the following lines to the
.env
file:👉 detailed instructions on how to get the bot token and chat IDTELEGRAM_BOT_TOKEN="your_token_here" TELEGRAM_CHAT_ID="your_chat_id_here"
-
Setup your Gmail app password:
- Go to Google Account Security.
- Select Two Step Verification and click App Password.
- Select Mail and Other (custom name).
- Enter a name for the app password, such as "OLXRadar".
- Copy the generated password.
- Add the following lines to the
.env
file:EMAIL_SENDER="[email protected]" EMAIL_RECEIVER="[email protected]" EMAIL_APP_PASSWORD="your_app_password"
-
Add a product URL to monitor:
- Search for a product on www.olx.ro.
- Copy the URL of the search results page.
- Add the URL to
target_urls.txt
, located in the project directory. Add one URL per line.
On Windows
Make sure you logged on as an administrator or you have the same access as an administrator, then go to:
Start -> Control Panel -> System and Security -> Administrative Tools -> Task Scheduler
Action -> Create Basic Task -> Type a name and Click Next
Follow through the wizard.
On Linux
- Open the crontab configuration file by running the following command:
crontab -e
- Add the following line to the end of the file to run the app every 30 minutes:
Replace
*/30 * * * * /path/to/OLXRadar/venv/bin/python /path/to/OLXRadar/main.py
/path/to/OLXRadar
with the actual path to the project directory.
The app will fetch the list of URLs to monitor from target_urls.txt
, scrape new ads, and send alerts via email and Telegram.
This project is licensed under the MIT License - see the LICENSE file for details.