From dfb19c04c76287fc419209a7fb7907c66758e569 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 2 Jul 2018 19:10:17 -0400 Subject: [PATCH] Updated the weather code. It works again, but may be flakey. Watch for bugs. Also, it should use F for people in the US and C for people who are not. --- src/talking-clock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/talking-clock b/src/talking-clock index 722ffde..86db9b2 100755 --- a/src/talking-clock +++ b/src/talking-clock @@ -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 'Temperature' | 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 'Temperature' | 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