Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schollz/pywebsitechanges
Change detection with a simple Python script to email you whenever a website changes.
https://github.com/schollz/pywebsitechanges
change-detection python website website-change-monitor
Last synced: 3 months ago
JSON representation
Change detection with a simple Python script to email you whenever a website changes.
- Host: GitHub
- URL: https://github.com/schollz/pywebsitechanges
- Owner: schollz
- License: mit
- Created: 2020-02-18T15:49:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T16:39:47.000Z (over 1 year ago)
- Last Synced: 2024-06-28T10:31:38.564Z (4 months ago)
- Topics: change-detection, python, website, website-change-monitor
- Language: Python
- Homepage: https://schollz.com/blog/pottery/
- Size: 10.7 KB
- Stars: 58
- Watchers: 4
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# websitechanges
A simple python script to email you whenever a website changes.
## Install
First install Node and Python on your system if you don't already. Then you will need the required packages which can be installed with `pip`:
pip install click numpy loguru scikit-image opencv-python
Then get the script:
wget https://raw.githubusercontent.com/schollz/websitechanges/master/websitechanges.py
And now run it whever - in a folder, in a cron, etc.
## Usage
```bash
$ python3 websitechanges.py --help
Usage: websitechanges.py [OPTIONS]Options:
--url TEXT url to watch [required]
--folder TEXT directory to store data
--css TEXT CSS selector of element to watch, default full page
--to TEXT email address of person to alert
--smtpemail TEXT SMTP email address
--smtppass TEXT SMTP email password
--threshold FLOAT threshold for sending email
```The `url` is the specified URL.
The `folder` specifies where to store all the data and puppeteer information.
The `css` will take a CSS query for a specific element you want to view. Otherwise it will capture the whole page.
To be alerted you will need to set `to` (the email to alert), `smtpemail` (the email sign-in for the SMTP), and `smtppass` (the password for the SMTP). You can easily setup a Gmail account to be used as an SMTP provider.
### Example
The simplest way to run is:
python3 websitechanges.py --url SOMEURL
This will automatically download puppeteer, which is used to gather the screenshot. It will also download a HOSTS file to block ads so that the website can be shown reproducibly.
Every alert will send you an image of the latest image, in low quality JPEG format in order to save on bandwidth.
Each time the script will only run once, so you will need to set up a cron job or a for loop to keep it continually running.
## License
MIT