Skip to content

Instantly share code, notes, and snippets.

@mattstep
Created January 10, 2013 18:59
Show Gist options
  • Save mattstep/4504784 to your computer and use it in GitHub Desktop.
Save mattstep/4504784 to your computer and use it in GitHub Desktop.
Jury Duty Checker Script
#!/bin/bash
GROUP_NO=3232
CURRENT_JD_STATUS="$(curl -X POST -d"groupNumber=$GROUP_NO" http://www.sanmateocourt.org/court_divisions/juror_services/jurorstatus.php | grep -A 5 'juryinstructions' | grep msg)"
while(true)
do
PREVIOUS_JD_STATUS=$CURRENT_JD_STATUS
CURRENT_JD_STATUS="$(curl -X POST -d"groupNumber=$GROUP_NO" http://www.sanmateocourt.org/court_divisions/juror_services/jurorstatus.php | grep -A 5 'juryinstructions' | grep msg)"
echo "Current status at " $(date) " is " $CURRENT_JD_STATUS
if [ "$CURRENT_JD_STATUS" != "$PREVIOUS_JD_STATUS" ]
then
echo "Change detected, emailing change"
echo $CURRENT_JD_STATUS | mutt 5551212@txt.att.net
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment