Skip to content

humzaredmi4-gif/Web-watcher

Repository files navigation

Website Change Watcher Telegram Bot

An advanced Telegram bot to monitor websites for content and visual changes, with keyword support and screenshot alerts.

Features

  • Monitor URLs: Check websites every 1 hour.
  • Content Change Detection: Hashes HTML content (stripping noise).
  • Visual Change Detection: Takes screenshots and detects visual differences.
  • Keyword Watchers: Alert when keywords appear or disappear.
  • Telegram Notifications: Get alerts with screenshots and diffs.
  • Admin Control: Manage monitors via Telegram commands.
  • Deployable: Ready for Railway (free tier optimized).

Setup & Installation

Local Development

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
  3. Install Playwright browsers:
    playwright install chromium
  4. Configure Environment:
    • Copy .env.example to .env
    • Set TELEGRAM_BOT_TOKEN (from BotFather)
    • Set ADMIN_IDS (comma-separated Telegram User IDs)
  5. Run the bot:
    python main.py

Deployment on Railway

  1. Fork/Clone this repo.
  2. Login to Railway and create a new project from the repo.
  3. Add the required Environment Variables in Railway settings:
    • TELEGRAM_BOT_TOKEN
    • ADMIN_IDS
  4. The included Dockerfile will handle the build and browser installation.

Commands

  • /start - Start the bot (Admin only)
  • /add <url> [tags] [notes] - Add a new monitor
  • /list - List active monitors
  • /remove <id> - Remove a monitor
  • /watch <monitor_id> <keyword> - Add a keyword watcher
  • /check - Force a check (Manual)
  • /status - View system status
  • /addadmin <user_id> - Add another admin
  • /help - Show help

Configuration

  • Interval: Hardcoded to 1 hour (per requirements).
  • Storage: SQLite (watcher.db), auto-created.

License

MIT