NOC Scraper e' uno strumento CLI per il monitoraggio automatizzato della sezione "Usato" del sito New Old Camera. Il software rileva nuovi prodotti (Fotocamere o Obiettivi) per i marchi specificati e invia notifiche tramite Telegram.
- Monitoraggio costante: Controllo automatico del sito a intervalli regolari (default: 60 secondi).
- Modalità Ibrida: Utilizzabile sia tramite menu interattivo che via argomenti da riga di comando (CLI).
- Filtri: Monitoraggio selettivo per brand (es. solo "Leica" o "Nikon").
- Notifiche Telegram: Alert contenenti modello, stato e prezzo.
- Resilienza: Gestione automatica degli errori di connessione.
Il progetto utilizza Poetry per la gestione delle dipendenze. Assicurati di averlo installato sul tuo sistema.
-
Clona il repository:
git clone https://github.com/ilveron/noc_scraper.git cd noc-scraper -
Installa le dipendenze:
poetry install
Per abilitare le notifiche è necessario configurare un bot Telegram.
- Rinomina il file
.env.examplein.env(se presente) o creane uno nuovo nella root del progetto. - Inserisci le credenziali ottenute da BotFather:
TELEGRAM_API_KEY=tuo_token_qui
TELEGRAM_CHAT_ID=tuo_chat_id_quiÈ possibile avviare lo script in due modalità tramite poetry.
Avvia lo script senza argomenti per visualizzare il menu di selezione.
poetry run python main.pyPassa gli argomenti direttamente da riga di comando per saltare i menu. Utile per cronjob o esecuzioni rapide.
-
Sintassi:
poetry run python main.py --type [camera|lens] --brands "Brand1, Brand2"
-
Esempi:
# Monitora fotocamere Sony e Nikon Z poetry run python main.py --type camera --brands "Sony, Nikon Z" # Monitora obiettivi Canon EOS R poetry run python main.py --type lens --brands "Canon EOS R"
- Continuous Monitoring: Automatically checks the website at regular intervals (default: 60s).
- Hybrid Mode: Works via interactive menus or Command Line Arguments (CLI).
- Filters: Monitor specific brands only.
- Telegram Alerts: Notifications include model, condition, and price.
- Error Handling: Automatically manages connection timeouts and retries.
This project uses Poetry for dependency management.
-
Clone the repository:
git clone https://github.com/ilveron/noc_scraper.git cd noc-scraper -
Install dependencies:
poetry install
To receive notifications, configure your Telegram Bot credentials.
- Create a
.envfile in the project root. - Add your API Key and Chat ID:
TELEGRAM_API_KEY=your_token_here
TELEGRAM_CHAT_ID=your_chat_id_hereRun the script using poetry.
Run without arguments to launch the selection menu.
poetry run python main.pyPass arguments to skip the interactive prompts.
-
Syntax:
poetry run python main.py --type [camera|lens] --brands "Brand1, Brand2"
-
Examples:
# Track Sony and Nikon cameras poetry run python main.py --type camera --brands "Sony, Nikon" # Track Leica lenses poetry run python main.py --type lens --brands "Leica"
IT: Questo software è stato creato a scopo didattico. L'autore non è affiliato con NewOldCamera. Utilizzare con responsabilità per non sovraccaricare il server.
EN: This software is for educational purposes only. The author is not affiliated with NewOldCamera. Please use responsibly to avoid server overload.