Skip to content

scrapes the homepage for a search string and sends a telegram message upon match.

Notifications You must be signed in to change notification settings

mmc102/hackernews-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hacker News Scraper with Telegram Alerts

A Python-based tool that monitors the Hacker News homepage for a specific search string (in titles and comments) and sends alerts to a Telegram chat when matches are found. The tool uses SQLite to store previous matches, so no duplicate alerts are sent. It runs periodically and can be deployed in a Docker container.

Requirements

  • Python 3.7+
  • Telegram Bot Token (see BotFather)
  • requests and python-telegram-bot Python packages

Installation

  1. Clone the Repository
 git clone https://github.com/your-repo/hackernews-scraper.git
 cd hackernews-scraper
  1. Set Up a Virtual Environment
python3 -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  1. Pip Install
pip install python-telegram-bot requests
  1. Create config.json
  {
    "telegram_bot_token": "your_telegram_bot_token_here",
    "telegram_chat_id": "your_telegram_chat_id_here",
    "search_string": "your_search_string_here",
    "sleep_time": 600
  }
  1. Run
  python3 main.py

Optionally run with docker

  docker build -t hackernews-scraper .
  docker run -d -v $(pwd)/config.json:/app/config.json hackernews-scraper

About

scrapes the homepage for a search string and sends a telegram message upon match.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published