Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer working #29

Open
GirlFriday opened this issue Mar 16, 2016 · 17 comments
Open

No longer working #29

GirlFriday opened this issue Mar 16, 2016 · 17 comments

Comments

@GirlFriday
Copy link

It doesn't seem to be able to fetch weather data anymore. All I get is "Could not retrieve weather data for New York, NY. Are you connected to the internet?

Yes I am, and it was working fine until 24 hours ago. Is Yahoo refusing data requests or something?

@felixhageloh
Copy link
Owner

It sounds like it might be Yahoo, especially if you can rule out any modifications to the widget the last 24h. Let me know if it fixes itself or otherwise could you have a look if there are any errors in the debug console and share them here?

@horus1963
Copy link

The widget has stopped working for me too 5 days ago. From the Yahoo website it looks like Yahoo has changed the way you make calls to their API on the 15th of March. Quoting from their website:

"To increase the security measure and better serving our YDN customers, weather data source will enforce OAuth 1 starting March 15, 2016. Please update your API calls with OAuth 1 enabled (via the OAuth /v1/yql end point if using YQL) using your Yahoo App key and secret.

old: https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=json

new: https://query.yahooapis.com/v1/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=json"

I believe the widget will need updating to reflect the above.

Thanks

@joecreighton
Copy link

I refreshed all widgets; I also quit Ubersicht and restarted it: curiously, mine was still working. So I grabbed the latest zip file and ran a diff. I was able to reproduce the failed and successful calls by swapping between these two statements in update():

% diff my-weather.widget/index.coffee current-weather.widget/index.coffee
185c185
<   channel = data?.query?.results?.weather?.rss?.channel
---
>   channel = data?.query?.results?.channel

This seems to contradict a recent patch at bc01106. Hope that helps.

@horus1963
Copy link

Thank you very much. That change worked!

@jnbt
Copy link
Contributor

jnbt commented Mar 22, 2016

@horus1963 @GirlFriday Which version we're you using? Because there was an update on Mar 4, 2016, to address YQL problems.

@jnbt
Copy link
Contributor

jnbt commented Mar 22, 2016

@horus1963
Copy link

I was using an old version when it stopped working. I then noticed that you had a new version so I downloaded it and only installed the get-weather as I did not want to redo all the mods I had in the index.coffee file. That did not work until I made the modification that you mentioned above. Now it working fine.

Also as for the link you posted above the response I get is:

{"query":{"count":1,"created":"2016-03-22T15:08:44Z","lang":"en-US","results":{"channel":{"title":"Yahoo! Weather - Bochum, DE","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Bochum__DE/*http://weather.yahoo.com/forecast/GMXX3998_c.html","description":"Yahoo! Weather for Bochum, DE","language":"en-us","lastBuildDate":"Tue, 22 Mar 2016 2:59 pm CET","ttl":"60","location":{"city":"Bochum","country":"Germany","region":"NW"},"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"wind":{"chill":"7","direction":"300","speed":"11.27"},"atmosphere":{"humidity":"73","pressure":"1013.6","rising":"2","visibility":""},"astronomy":{"sunrise":"6:29 am","sunset":"6:49 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions for Bochum, DE at 2:59 pm CET","lat":"51.49","long":"7.21","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Bochum__DE/*http://weather.yahoo.com/forecast/GMXX3998_c.html","pubDate":"Tue, 22 Mar 2016 2:59 pm CET","condition":{"code":"26","date":"Tue, 22 Mar 2016 2:59 pm CET","temp":"9","text":"Cloudy"},"description":"\n<img src="http://l.yimg.com/a/i/us/we/52/26.gif\"/>
\nCurrent Conditions:
\nCloudy, 9 C
\n
Forecast:
\nTue - Cloudy. High: 11 Low: 6
\nWed - AM Showers. High: 9 Low: 1
\nThu - Mostly Cloudy. High: 11 Low: 6
\nFri - Light Rain. High: 9 Low: 6
\nSat - Partly Cloudy. High: 15 Low: 8
\n
\n<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Bochum__DE/*http://weather.yahoo.com/forecast/GMXX3998_c.html\">Full Forecast at Yahoo! Weather

\n(provided by <a href="http://www.weather.com\" >The Weather Channel)
\n","forecast":[{"code":"26","date":"22 Mar 2016","day":"Tue","high":"11","low":"6","text":"Cloudy"},{"code":"39","date":"23 Mar 2016","day":"Wed","high":"9","low":"1","text":"AM Showers"},{"code":"28","date":"24 Mar 2016","day":"Thu","high":"11","low":"6","text":"Mostly Cloudy"},{"code":"11","date":"25 Mar 2016","day":"Fri","high":"9","low":"6","text":"Light Rain"},{"code":"30","date":"26 Mar 2016","day":"Sat","high":"15","low":"8","text":"Partly Cloudy"}],"guid":{"isPermaLink":"false","content":"GMXX3998_2016_03_26_7_00_CET"}}}}}}

@jnbt
Copy link
Contributor

jnbt commented Mar 24, 2016

Now the API also responds for me with an error. I'm having the feeling that Yahoo is migrating their servers and rolling out the OAuth requirement.

I'm not sure what would be better:

a) Adopting the OAuth change: As far as I understood the change every user would need to generate an API token
b) Using a different data provider

@horus1963
Copy link

Same here. Stopped working yesterday giving a security error. Using curl -s http://weather.yahooapis.com/forecastrss?w=WOEID; where I substitute the ID for my city; still works though through terminal.

@GirlFriday
Copy link
Author

Started working again briefly and then stopped. Are you going to fix this or what? I think the suspicion about the API is correct. This is what I get when I click the URL above:

{"query":{"count":1,"created":"2016-03-26T17:55:53Z","lang":"en-us","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! Weather - Bochum, NW, DE","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-639679/","description":"Yahoo! Weather for Bochum, NW, DE","language":"en-us","lastBuildDate":"Sat, 26 Mar 2016 06:55 PM CET","ttl":"60","location":{"city":"Bochum","country":"Germany","region":" NW"},"wind":{"chill":"57","direction":"185","speed":"28.97"},"atmosphere":{"humidity":"44","pressure":"33863.90","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:17 am","sunset":"6:57 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions for Bochum, NW, DE at 06:00 PM CET","lat":"51.486439","long":"7.21079","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-639679/","pubDate":"Sat, 26 Mar 2016 06:00 PM CET","condition":{"code":"39","date":"Sat, 26 Mar 2016 06:00 PM CET","temp":"15","text":"Scattered Showers"},"forecast":[{"code":"28","date":"26 Mar 2016","day":"Sat","high":"15","low":"5","text":"Mostly Cloudy"},{"code":"11","date":"27 Mar 2016","day":"Sun","high":"11","low":"8","text":"Showers"},{"code":"23","date":"28 Mar 2016","day":"Mon","high":"11","low":"7","text":"Breezy"},{"code":"12","date":"29 Mar 2016","day":"Tue","high":"10","low":"6","text":"Rain"},{"code":"12","date":"30 Mar 2016","day":"Wed","high":"11","low":"5","text":"Rain"},{"code":"39","date":"31 Mar 2016","day":"Thu","high":"9","low":"4","text":"Scattered Showers"},{"code":"12","date":"01 Apr 2016","day":"Fri","high":"9","low":"3","text":"Rain"},{"code":"28","date":"02 Apr 2016","day":"Sat","high":"10","low":"3","text":"Mostly Cloudy"},{"code":"28","date":"03 Apr 2016","day":"Sun","high":"12","low":"4","text":"Mostly Cloudy"},{"code":"28","date":"04 Apr 2016","day":"Mon","high":"13","low":"5","text":"Mostly Cloudy"}],"description":"\n
\nCurrent Conditions:\n
Scattered Showers\n
\n
\nForecast:\n
Sat - Mostly Cloudy. High: 15Low: 5\n
Sun - Showers. High: 11Low: 8\n
Mon - Breezy. High: 11Low: 7\n
Tue - Rain. High: 10Low: 6\n
Wed - Rain. High: 11Low: 5\n
\n
\nFull Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}

@GirlFriday
Copy link
Author

Oh, and as far as I can tell I have the updated version installed.

@felixhageloh
Copy link
Owner

It's a shame - initially I used forecast.io and the reason to switch to yahoo was that it didn't require people to get their own API token.

We could go back to forecast.io but it wouldn't really be much better than having people get a yahoo oauth key. Another option would be to investigate some alternative apis like http://lifehacker.com/get-a-quick-weather-forecast-with-a-terminal-command-1760639048?utm_medium=sharefromsite&utm_source=Lifehacker_twitter

@horus1963
Copy link

@felixhageloh I personally would rather get a yahoo oauth key rather than not have the widget at all.

@ChiefPoints
Copy link

I'd rather get a yahoo oauth key as well, seems the least disruptive way forward. Would love to see an update that covers that route.

@roele
Copy link

roele commented Apr 3, 2016

If OAuth would be painless i wouldn't mind setting that up initially as well but i guess this would require a setup script and since the token will expire after 3600 seconds a token refresh would need to be built in as well.

Playing with https://developer.yahoo.com/weather/ does also show the mentioned behaviour. I assume their API is simply broken again (not the first time!). Some attempts return results, some don't i guess depends to what servers the requests get routed.

@felixhageloh
Copy link
Owner

I'm beginning to think that forecast IO will be the easiest route. I currently have very little time to look into this so it will probably take a while till I have a fix. In the meantime PRs are welcome!

@kristjankullerkann
Copy link

@felixhageloh perhaps you might consider taking a look at https://www.wunderground.com/ when you have some spare time.
They also have API etc. (unfortunately authentication key is required).

imho they stand out as forecasts are "crowdsourced".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants