There is a telegram channel that posts details of all EVM contracts deployed on the Ethereum L2 chain called Base. This tool scrapes the telegram channel and stores the parsed data into a local db for further analysis. Goal is to catch any non-scammy\unique contracts that are deployed for 💰 🚀 mission. :)
This tool:
- Connects to Telegram using API credentials
- Fetches messages from a specified channel
- Extracts token deployment information
- Stores data in SQLite database
- Handles rate limiting and interruptions
- Optimizes batch processing
pip install -r requirements.txt
Create config.env:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
graph TD
A[Start] --> B[Initialize Database]
B --> C[Get Last Processed tg message ID]
C --> D[Fetch Latest Message]
D --> E[Calculate New Messages]
E --> F[Process Messages in Batches]
F --> G{More Messages?}
G -->|Yes| H[Extract Token Info]
H --> I[Store in Database]
I --> J[Update Last Processed ID]
J --> F
G -->|No| K[Done]
F --> L{API Warning?}
L -->|Yes| M[Wait & Retry]
M --> F
L -->|No| G
- Starts from most recent message
- Processes in reverse chronological order
- Adapts batch size dynamically based on:
- Processing time
- API rate limits
- Previous successful batch sizes
- Handles Telegram API flood warnings
- Preserves progress on interruption
- Resumes from last processed message
- Adapts batch size for optimal performance
python tgExport.py
Monitor progress in terminal with:
- Total messages to process
- Current batch size
- Processing speed
- Telegram API status warnings