I'm very lazy. Rather than having to keep track of Cambridge bin collection days manually, especially around holidays, I wrote a thing to convert it into an
iCalendar file for me so that I could import it into Google Calendar. Here it is in case it's useful to anyone else:
#! /usr/bin/python3
(
Read more... )
Comments 1
to be run each evening from cron -- this way schedule changes should still be caught, but it doesn't have iCal integration:
#!/bin/bash
TOMORROW=`date --date=tomorrow '+%-d %B'`
BODY=`w3m -no-cookie -dump 'http://bins.cambridge.gov.uk/bins.php?uprn=10002568779' | grep -B2 "^${TOMORROW}" -`
if [ -n "$BODY" ]
then
echo "Details at http://bins.cambridge.gov.uk/bins.php?uprn=10002568779" | mail -a "From: Bin Reminder " -s "Bin day: $BODY" emaildestination@example.internal
fi
Reply
Leave a comment