Created
December 21, 2017 20:16
-
-
Save bmiro/9baba6f5c116c34d7b2518b249067bae to your computer and use it in GitHub Desktop.
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 | |
url="https://resultats.parlament2017.cat/09AU/DAU09999CM.htm" | |
last="" | |
while true | |
do | |
hour=$(curl -s "$url?$RANDOM" | \ | |
grep '="hora"> .* <\/span>' | \ | |
sed 's#.*=\"hora\"> \(.*\) </span></span>.*#\1#' | \ | |
sed 's/ h /:/') | |
perc=$(curl -s "$url?$RANDOM" | \ | |
grep xescrutado | \ | |
awk -F'Counted' '{ print $2 }' | \ | |
awk -F'span' '{ print $3 }' | \ | |
sed 's#[<>/]##g') | |
if [ "$last" != "$perc" ] | |
then | |
last="$perc" | |
echo "$hour $perc" | |
beep | |
fi | |
sleep 30s | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment