Emails the latest comic to the recipient specified in settings.
Checks xkcd's latest comic, using the xkcd api at http://xkcd.com/info.0.json
If the latest comic is new, emails the comic to the user and records the comic as seen. Optionally downloads comics to ./comics/
- clone this repo
- copy example.env to .env
- Edit .env with your configuration, filling in your send_method (smtp or sendgrid), username, password, or api key
- (optional) configure a virtualenv for this project:
mkvirtualenv xkcd_checker
pip3 install -r requirements.txt
- Run from command line:
python3 xkcd_checker.py
- Script will create xkcd_history.txt and (if
XKCD_DOWNLOAD=True
) comics/ directory - (optional) install as cron job
- python3
- MacOS or Ubuntu (tested on 20.04-24.04)
- Emails only the latest comic. Will not catch multiple missed comics since last run. (e.g. if last is 1630 and current is 1632, will skip 1631)
- Only accepts one recipient
- Must have file write access in script's directory
- Only supports sendgrid and smtp at this time
- Support comic backfill (one email for each comic since last run)
- Make email body html prettier
- Test other email providers
- Maybe use tinydb, lmdb, rocksdb, boltdb, or sqlite instead of xkcd_history.txt