Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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