A script that scans through sites and checks for differences for you. Requires requests and html2text, plus other dependencies if you want email updates.
After setup, you can just run sitewatch.py, perhaps with a scheduling tool.
Probably. nothing works on not-Windows. (TODO)
Two things.
-
You can change the list of sites in
sitelist.csv. Each row is one site. There are three columns:- The name you want the site to go by (e.g. "xkcd")
- The link to the site (e.g. "xkcd.com")
- The mode you want to process the site by:
htmlmode will read the HTML of the page. (Note that for most modern websites this will give you a bunch of false positives.)textmode will read the words on the page, and also check the names of the images.linkmode does everythingtextdoes, but also checks all the hyperlinks are the same.
sitewatch also saves the HTML pages of websites it's seen, so you can go to
~\Documents\sitewatchand diff them if you want to see what changed. Occasionally, you also probably want to clean that folder out. (TODO - automatically do this) -
If you don't want email notifications when sitewatch detects a change in a site, you should write
{"emails":"false"}intooptions.json. If you do want email notifications, proceed to the next section. (Note that with a bit of work you can e.g. use this to update a Rainmeter skin instead.)
If you want email notifications then write {"emails":"true", "from":"(send from email)", "to":"(send to email)"} into options.json. Your "send from" email must be accessible with the Gmail API, so any gmail should work.
Next, get:
- google-api-python-client:
pip install --upgrade google-api-python-client - google-auth-oauthlib:
pip install google-auth-oauthlib
Credentials setup (with the "from" email):
- Go to console.cloud.google.com, and log in with the desired email.
- Make a new project, or use an arbitrary existing one. Set its location to "No Organization".
Configure oauth consent screen:
- At the OAuth Consent Screen, set the user type to "External" (since you don't have an organization).
- Fill in the app name as "emailer" (or whatever; it doesn't matter), and the support email as your email. No optional fields matter.
- To select scopes, first go to the API library from the OAuth Consent Screen (in a separate tab) and enable the Gmail API. Then, return to the app-registration screen and add the Gmail modify scope:
https://www.googleapis.com/auth/gmail.modify. - Set yourself as a test user.
Get credentials:
- Go to Menu > APIs & Services > Credentials.
- Click Create Credentials > OAuth client ID.
- Set the application type as "Desktop App", fill in other fields, and finish.
- Download the JSON file; move it into the emailer directory and rename it
credentials.json.