Last active
December 18, 2015 13:08
-
-
Save bijanebrahimi/5787282 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 | |
TMP_FILE="/tmp/election" | |
wget -qO- http://election.farsnews.com/electioninfo.js | sed 's/var //' | sed 's/ = /=/' | sed "s/\[/\(/" | sed "s/\]/\)/" > $TMP_FILE | |
source "$TMP_FILE" | |
echo "last Update: "${categoryarray[${#categoryarray[@]}-1]} | |
echo "$lastTotal ($lastCounted, $lastFailed)" | |
echo "%"$(echo "scale = 4; ($lastRohani / $lastTotal) * 100" | bc 2>/dev/null)" Rohani with $lastRohani votes" | |
echo "%"$(echo "scale = 4; ($lastQalibaf / $lastTotal) * 100" | bc 2>/dev/null)" Qalibaf with $lastQalibaf votes" | |
echo "%"$(echo "scale = 4; ($lastJalili / $lastTotal) * 100" | bc 2>/dev/null)" Jalili with $lastJalili votes" | |
echo "%"$(echo "scale = 4; ($lastRezaei / $lastTotal) * 100" | bc 2>/dev/null)" Rezaee with $lastRezaei votes" | |
echo "%"$(echo "scale = 4; ($lastVelayati / $lastTotal) * 100" | bc 2>/dev/null)" Velayati with $lastVelayati votes" | |
echo "%"$(echo "scale = 4; ($lastQarazi / $lastTotal) * 100" | bc 2>/dev/null)" Qarazi with $lastQarazi votes" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment