Giter Site home page Giter Site logo

devtonic-net / olxradar Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 2.0 22 KB

Get notified instantly of new listings on OLX with this Python app that sends alerts via Telegram and email.

Python 100.00%
email marketing notifications olx python telegram telegram-bot

olxradar's Introduction

OLXRadar

OLXRadar

Get notified instantly of new listings on OLX with this Python app that sends alerts via Telegram and email.

Prerequisites

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)

Installation

  1. Clone/download this repository to your local machine.

  2. Open a terminal and navigate to the project directory.

  3. Create a new virtual environment by running the following command:

    python3 -m venv venv
    
  4. Activate the virtual environment:

    source venv/bin/activate
    
  5. Install the required packages:

    pip install -r requirements.txt
    
  6. Setup your Telegram bot:

    1. Create a new bot by talking to the BotFather.
    2. Copy the bot token.
    3. Send a message to your bot and get the chat ID.
    4. Copy the chat ID.
    5. Create a file named .env in the project directory.
    6. Add the following lines to the .env file:
      TELEGRAM_BOT_TOKEN="your_token_here"
      TELEGRAM_CHAT_ID="your_chat_id_here"
      
      ๐Ÿ‘‰ detailed instructions on how to get the bot token and chat ID
  7. Setup your Gmail app password:

    1. Go to Google Account Security.
    2. Select Two Step Verification and click App Password.
    3. Select Mail and Other (custom name).
    4. Enter a name for the app password, such as "OLXRadar".
    5. Copy the generated password.
    6. Add the following lines to the .env file:
      EMAIL_SENDER="[email protected]"
      EMAIL_RECEIVER="[email protected]"
      EMAIL_APP_PASSWORD="your_app_password"
      
  8. Add a product URL to monitor:

    1. Search for a product on www.olx.ro.
    2. Copy the URL of the search results page.
    3. Add the URL to target_urls.txt, located in the project directory. Add one URL per line.

How to get a search url

Usage. How to schedule the app to run at fixed intervals

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

  1. Open the crontab configuration file by running the following command:
    crontab -e
    
  2. Add the following line to the end of the file to run the app every 30 minutes:
    */30 * * * * /path/to/OLXRadar/venv/bin/python /path/to/OLXRadar/main.py
    
    Replace /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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

olxradar's People

Contributors

devtonic-net avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.