This script monitors Telegram channels and groups for job vacancies, filters them by keywords, and saves the results to Google Sheets.
- Monitors specified Telegram channels and groups
- Filters messages by job-related keywords
- Saves job vacancies to Google Sheets
- Runs automatically every hour
- Includes error handling and logging
- Prevents duplicate entries
- Python 3.7 or higher
- Telegram API credentials (API_ID and API_HASH)
- Google Sheets API credentials
- Access to the Telegram channels/groups you want to monitor
- Install the required packages:
pip install -r requirements.txt
-
Set up Telegram API credentials:
- Go to https://my.telegram.org/auth
- Log in and create a new application
- Get your
API_ID
andAPI_HASH
-
Set up Google Sheets API:
- Go to Google Cloud Console
- Create a new project
- Enable Google Sheets API
- Create a service account and download the credentials JSON file
- Rename it to
google_credentials.json
and place it in the project directory - Share your Google Sheet with the service account email
-
Create a
.env
file with your credentials:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
TELEGRAM_PHONE=your_phone_number
GOOGLE_SHEETS_ID=your_spreadsheet_id
- Configure the channels to monitor:
- Open
config.py
- Add the channel/group usernames or IDs to the
CHANNELS
list - Optionally modify the
KEYWORDS
list to filter different terms
- Open
Run the script:
python telegram_job_monitor.py
The script will:
- Connect to Telegram
- Monitor the specified channels
- Filter messages containing job-related keywords
- Save matching messages to Google Sheets
- Run every hour automatically
The script saves the following information to Google Sheets:
- Timestamp
- Channel name
- Message ID
- Message text
- Direct link to the message
The script creates a telegram_monitor.log
file that contains:
- Connection status
- Successful saves
- Errors and exceptions
The script includes comprehensive error handling for:
- API connection issues
- Message processing errors
- Google Sheets API errors
- Channel access problems
Feel free to submit issues and enhancement requests!