googlecodelabs / your-first-pwapp

Code associated with Your First Progressive Web App codelab
https://g.co/codelabs/pwa
Apache License 2.0
638 stars 555 forks source link

Yahoo weather API mostly not returning results #82

Closed gbittmann closed 5 years ago

gbittmann commented 7 years ago

I was thinking there was something wrong with the examples, but then I checked the yahoo weather API calls and most of the time this is what you get obviously the created part changes. It works so infrequently it makes the example itself seem broken.

{"query":{"count":0,"created":"2017-01-12T13:40:37Z","lang":"en-US","results":null}}

JamieMason commented 7 years ago

When a response like the above is received, line 180 of app.js throws because results is null;

screen shot 2017-01-12 at 16 27 19

caleuanhopkins commented 7 years ago

Think Yahoo weather has changed it's query system. The app is sending a http request like the follow: https://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=2459115

Might need to find a new api to query the weather from. I'd suggest http://api.openweathermap.org but the tutorial would need to be re-coded to fit their api and an appid would need to be acquired for the tutorial. They have a 5 day weather forecast api endpoint and their free plan allows up to 60 queries per minute which should fit the tutorial nicely. (for more info: http://openweathermap.org/price)

petele commented 5 years ago

Hi!

Thanks for the feedback. I've rewritten the codelab from scratch and believe I have fixed this issue. The code has been updated, and the new guide is now live.

If you find any issues with the new codelab, please let us know!

Thanks!