Skip to content

Instantly share code, notes, and snippets.

@XertroV
Created September 10, 2016 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XertroV/03a7329057067eefe183a47103703747 to your computer and use it in GitHub Desktop.
Save XertroV/03a7329057067eefe183a47103703747 to your computer and use it in GitHub Desktop.
little bash script to notify aurally when results come in for Byron Council Elections
NORESULTS='class="sum02"><tdcolspan="3">ProgressiveTotalVotes</td><tdclass="r"></td><tdclass="empty"></td><tdclass="empty"></td><tdclass="empty"></td></';
while sleep 1; do
echo 'running';
RESULTS=$(curl -s http://votensw.info/data/byron-shire-council/summary_councillor.html | tr -d ' ' | tr -d '\n' | sed 's/tr/\'$'\n/g' | grep sum02);
if [ "$RESULTS" == "$NORESULTS" ] ; then
echo 'no results' ;
# say 'no results' # debug only
else
echo 'results';
say 'results are in';
fi;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment