This repository is a template for setting up a scheduled website monitor using Python, Playwright, and ntfy.sh via GitHub Actions. It scrapes a specific element from a target webpage and sends a push notification to your phone or desktop when the text of that element changes.
The project is built with professional standards including centralized configuration, logging, and automated code linting via ruff.
- Click the green Use this template -> Create a new repository button.
- Name your new repository whatever you want.
- Go to your new repository's Settings -> Secrets and variables -> Actions.
- Add your specific environment variables (
NTFY_TOPIC,TARGET_URL) as New repository secrets. - Edit the
.github/workflows/schedule.ymlfile to enable the action and set your preferred time.
- Clone your new repository to your local machine.
- Install the required Python packages:
pip install -r requirements.txt
python -m playwright install chromium- Copy the
.env.examplefile and rename it to.env. Fill in your configuration values. - Open
scraper.pyand modify the Playwright selector to target the specific website element you want to monitor.
ntfy.sh is a simple HTTP-based pub-sub notification service.
- Install the ntfy app on your phone (iOS/Android) or use the web interface.
- Subscribe to a unique topic name of your choice (e.g.,
my_secret_scraper_topic). - Use that exact topic name for your
NTFY_TOPICenvironment variable or secret. - When the script detects a website change, it will send an instant notification to your subscribed topic!