Notifier is a versatile web scraper that monitors websites for changes and sends notifications. Easily define scrape rules with CSS selectors in a JSON config file and format alerts with Liquid templates. Designed for cron job integration, it allows for flexible scheduling to suit various monitoring needs.
Notifier is a versatile, config-driven web scraper designed to efficiently monitor websites for changes and deliver timely email notifications. Users can easily define scraping parameters using CSS selectors within a JSON configuration file, while the tool formats notifications through Liquid templates, providing flexibility in how updates are presented.
Notifier is intended to run periodically via system cron jobs, processing rules based on defined schedules. Below are the primary commands:
python3 index.py # Process rules scheduled to run
python3 index.py --force # Execute all rules immediately
python3 index.py --dry-run # Fetch and display data without making changes
python3 index.py --save-email # Store emails to a file instead of sending
python3 index.py --validate # Validate configuration against schema
python3 index.py --verbose # Display detailed output during execution
python3 index.py -q # Suppress output, including errors
The Notifier configuration is divided into three primary sections within the config.json file:
Here is a sample of how to define a scraping task:
"hackernews": {
"url": "https://news.ycombinator.com",
"query": {
"type": "list",
"selector": "tr.athing.submission",
"variables": {
"title": { "selector": ".titleline > a", "value": { "type": "text" } }
}
}
}
The tool includes robust error reporting, notifying users of configuration issues, failure to fetch data, or changes in HTML structure. Notifications are dispatched to all unique email addresses set across rules, ensuring that users remain informed about the scraper's status and any action required.
Notifier can be utilized for various monitoring tasks:
Notifier offers a sophisticated solution for users looking to automate their web scraping and monitoring processes, combining ease of use with powerful customization features. The integration of Javascript templates allows for tailored notifications, keeping users updated on critical changes in the online landscape.
No comments yet.
Sign in to be the first to comment.