Skip to content

Commit

Permalink
Updated the weather code. It works again, but may be flakey. Watch fo…
Browse files Browse the repository at this point in the history
…r bugs. Also, it should use F for people in the US and C for people who are not.
  • Loading branch information
stormdragon2976 committed Jul 2, 2018
1 parent 6ddc77c commit dfb19c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/talking-clock
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ if [ "$speakTime" == "true" ] ; then
#Add temperature if zipcode is set
if [ -n "$zipcode" ] ; then
if [ "$torify" == "true" ] ; then
temperature="$(torify curl -s "http://mobile.wunderground.com/cgi-bin/findweather/getForecast?brand=mobile&query=${zipcode}" | grep -A 2 '<tr><td>Temperature</td>' | tr -cd '[:digit:]-.' | cut -d . -f1)"
temperature="$(torify curl -s "http://wttr.in/$zipcode?T" | grep -m 1 -Eo -e '-?[[:digit:]].*[CF]' | cut -d ' ' -f1 | sed 's/.*-//')"
else
temperature="$(curl -s "http://mobile.wunderground.com/cgi-bin/findweather/getForecast?brand=mobile&query=${zipcode}" | grep -A 2 '<tr><td>Temperature</td>' | tr -cd '[:digit:]-.' | cut -d . -f1)"
temperature="$(curl -s "http://wttr.in/$zipcode?T" | grep -m 1 -Eo -e '-?[[:digit:]].*[CF]' | cut -d ' ' -f1 | sed 's/.*-//')"
fi
if [ -n "$temperature" ] ; then
if [ "$format" = "24" ]; then
Expand Down

0 comments on commit dfb19c0

Please sign in to comment.