a scrapy crawler for checking a compass card balance and alerting if it is wrong
Requires python 3 and Scrapy
Get scrapy here: [https://scrapy.org/]
Before you run this, you should collect the following
- your compass card
- your compass card cvn
- your email ( currently it's set up for gmail )
- your gmail password ( you'll want to generate an app specific password, see instructions below if you need help)
- the maximum amount you expect your balance to change between runs ( 0 for monthly )
scrapy runspider compass.py
if it is your first run, you will be asked to set up some info, which will be stored in a local file called compassConfig.ini
Make a batch file with the above command and create a scheduled task.
I personally have it set to run once a day about an hour after I last usually travel.
Either modify the .ini file directly or run
scrapy runspider compass.py -a reconfig=1
- Go to https://myaccount.google.com/security?utm_source=OGB&utm_medium=act#signin
- Click on App passwords
- Verify your identity with Google
- in the dropdown at the bottom, enter a custom name (that you'll remember for the app password)
- click Generate
- make a copy of this password, you'll only get it once
- error handling. If compass changes their site, or we fail to parse for some reason, send an email
- potentially handle multiple compass cards and CVNs