ext_169790 ([identity profile] james-r.livejournal.com) wrote in [personal profile] cjwatson 2016-12-28 07:06 pm (UTC)

Alternative method

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 <nobody@jump.org.uk>" -s "Bin day: $BODY" emaildestination@example.internal
fi

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting