Created
November 5, 2015 19:46
-
-
Save adamwalz/ec4c1e939b3806854a2f to your computer and use it in GitHub Desktop.
Gets history weather data for use by OpenSprinkler
This file contains 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 | |
date=$1 | |
wunderground_key="INSERT KEY HERE" | |
summary="$(http http://api.wunderground.com/api/${wunderground_key}/history_${date}/q/UT/Sandy.json | jsawk 'return this.history.dailysummary[0]')" | |
minhumidity=$(echo $summary | jsawk 'return this.minhumidity') | |
maxhumidity=$(echo $summary | jsawk 'return this.maxhumidity') | |
temp=$(echo $summary | jsawk 'return this.meantempi') | |
precip=$(echo $summary | jsawk 'return this.precipi') | |
echo "$minhumidity $maxhumidity $temp $precip" |
This file contains 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
for i in `seq -f "%02g" 1 31`; do | |
./history.sh 201508${i} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment