Created
September 29, 2010 02:02
-
-
Save henare/602186 to your computer and use it in GitHub Desktop.
Regularly checks APH to see if Hansard has been posted yet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 protected] | |
# 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