This is a tool that sends you an email when it has detected changes between your local state (stored in lastPrices.json
) and data pulled from a URL.
I have used this to monitor the price/avaliability of apartments at a specific complex. This tool works best when it is set to run on a cron job, so that you can get regular updates.
- Add run the depency installation:
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client
(orpip install -r requirements.txt
) - Get your credentials (credentials.json) from the Google Cloud Console (this may involve making a new project with the Gmail API enabled)
- Get added as a test user in the Google Cloud Console project
- Set Control/Config Vars (below) to your desired settings + potentially
room_types
andfields
MOCK
- If True, the script will prefill 'changes' with a mock response to make testing the email sending easierSENDEMAIL
- If True, the script will send an email if there are changesVERBOSE
- If True, the script will print out the changes it has detected + additional information
pullMT.py
- Main script: pulls + parses data, compares it to the last pulled data, and sends an email if there are changessendGmail.py
- Script to send an email using the Gmail APIlastPrices.json
- File to store the last pulled datacredentials.json
- File to store your Google Cloud credentialstoken.json
- File generated by the Google Cloud API when you run the script for the first time (and everytime you need to reauthenticate)