# Website Change Monitor with Telegram Notifications This script monitors https://tickets.cafonline.com/ for any changes in its content. If a change is detected, it sends a notification to a designated Telegram channel or group. ## Features - ๐Ÿ” Monitors website content changes using MD5 hash comparison - ๐Ÿ“ฑ Sends notifications via Telegram bot - โฐ Configurable check interval (default: 60 seconds) - ๐Ÿ”„ Runs as a systemd service for continuous monitoring - ๐Ÿ“ Comprehensive logging - ๐Ÿงช Built-in test functionality ## Quick Setup 1. **Install dependencies:** ```bash sudo ./setup.sh ``` 2. **Configure Telegram bot:** - Create a bot with [@BotFather](https://t.me/botfather) - Get your bot token - Add the bot to your channel/group - Get the chat ID - Edit `config.json` with your credentials 3. **Test configuration:** ```bash python3 website_monitor.py --test ``` 4. **Start monitoring:** ```bash sudo systemctl start website-monitor sudo systemctl enable website-monitor ``` ## Configuration Edit `config.json`: ```json { "website": { "url": "https://tickets.cafonline.com/" }, "telegram": { "bot_token": "YOUR_BOT_TOKEN_HERE", "chat_id": "YOUR_CHAT_ID_HERE" }, "monitoring": { "check_interval_seconds": 60 } } ``` ## Getting Telegram Bot Token 1. Message [@BotFather](https://t.me/botfather) on Telegram 2. Send `/newbot` and follow the instructions 3. Copy the bot token to your config ## Getting Chat ID 1. Add your bot to the channel/group 2. Send a message in the channel/group 3. Visit: `https://api.telegram.org/bot/getUpdates` 4. Find the chat ID in the response ## Service Management - **Start:** `sudo systemctl start website-monitor` - **Stop:** `sudo systemctl stop website-monitor` - **Status:** `sudo systemctl status website-monitor` - **Logs:** `journalctl -u website-monitor -f` ## Files - `website_monitor.py` - Main monitoring script - `config.json` - Configuration file - `requirements.txt` - Python dependencies - `website-monitor.service` - Systemd service file - `setup.sh` - Setup script - `website_monitor.log` - Log file (created when running) ## Troubleshooting - Check logs: `journalctl -u website-monitor -f` - Test Telegram: `python3 website_monitor.py --test` - Verify config: `python3 -c "import json; print(json.load(open('config.json')))"`