Skip to content

Instantly share code, notes, and snippets.

@henare
Created September 29, 2010 02:02
Show Gist options
  • Save henare/602186 to your computer and use it in GitHub Desktop.
Save henare/602186 to your computer and use it in GitHub Desktop.
Regularly checks APH to see if Hansard has been posted yet
#!/bin/bash
# Regularly checks APH to see if Hansard has been posted yet.
#
# Just run it on the command line to check yesterday's Handsard and press
# Ctrl-C when you want to stop checking
# Email address to notifiy
EMAIL=henare@openaustralia.org
# House to check, put 's' for Senate or 'r' for House of Reps
HOUSE=r
# Date to check for. The command below checks yesterday
HANDARD_DATE=`date -d yesterday +%Y-%m-%d`
while true; do
date
wget -N -q "http://parlinfo.aph.gov.au/parlInfo/search/summary/summary.w3p;query=Id:chamber/hansard$HOUSE/$HANDARD_DATE/0000"
if [ -n "`grep "No results found." 0000`" ]; then
echo "Nope, no Hansard yet"
else
echo "Yay, looks like it's up. Emailing you"
echo "Hansard for $HANDARD_DATE is ready" | mail -s "Hansard for $HANDARD_DATE posted" $EMAIL
fi
sleep 10m
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment