Skip to content

Latest commit

 

History

History
98 lines (67 loc) · 2.32 KB

File metadata and controls

98 lines (67 loc) · 2.32 KB

Allegro Bad Ratings Monitor

This project monitors Allegro offers for bad ratings (1–3 stars) and sends email alerts whenever new negative ratings are detected. It uses the Allegro API, a local SQLite database for tracking offers & ratings, and SMTP for email notifications.


🚀 Features

  • Authenticates with the Allegro API using OAuth2.
  • Fetches active offers and their ratings.
  • Detects new bad ratings (1, 2, or 3 stars).
  • Stores offers and ratings in a local SQLite database.
  • Sends email notifications with bad ratings summary.
  • Rate-limited API requests to respect Allegro limits.

🛠️ Tech Stack


⚙️ Setup

1. Clone repository

git clone https://github.com/veritasdol/Allegro-offers-rating.git
cd Allegro-offers-rating

2. Create virtual environment

python -m venv venv
source venv/bin/activate   # Linux / macOS
venv\Scripts\activate      # Windows

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

Create a .env file in the project root:

CLIENT_ID=your_allegro_client_id
CLIENT_SECRET=your_allegro_client_secret
REDIRECT_URI=your_redirect_uri
ALLEGRO_API_URL=https://api.allegro.pl

SMTP_SERVER=smtp.example.com
EMAIL_PORT=465
EMAIL_FROM=alerts@example.com
EMAIL_PASSWORD=your_email_password
EMAIL_TO=recipient@example.com

5. Initialize database

The database (allegro.db) is created automatically on first run. It contains two tables:

  • offers — tracked Allegro offers
  • ratings — ratings linked to offers

▶️ Usage

Run the main script:

python main.py

The script will:

  1. Fetch all active offers from Allegro.
  2. Check for new bad ratings.
  3. Update the database.
  4. Send an email notification if new bad ratings are found.

📜 License

MIT License — feel free to use and modify.