Small data hack: bin day calendar

Dec 28, 2016 15:26

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... )

programming

Leave a comment

Comments 1

Alternative method james_r December 28 2016, 19:06:31 UTC
I'm even more lazy, this was only 7 lines :-)

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

Up