Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

simpleWeather is currently not working. #174

Closed
DukeBaird opened this issue Jan 19, 2016 · 104 comments
Closed

simpleWeather is currently not working. #174

DukeBaird opened this issue Jan 19, 2016 · 104 comments
Assignees
Labels

Comments

@DukeBaird
Copy link

Possible duplicate of open issue, but simpleweather sometimes errors and calls no callbacks.

jquery.simpleWeather.min.js:2 Uncaught TypeError: Cannot read property 'channel' of null

However, its not triggering the error function on the original query

$.simpleWeather({
                    location: 'Waterloo',
                    woeid: '',
                    unit: 'c',
                    success: function(weather) {
                        $("#curTemp").html("Outdoor Weather: " + weather.temp + "°C, " + weather.currently);
                    },
                    error: function(error) {
                        $('#curTemp').html("Could not get Weather data");
                    }

Is there a way to make it call the error callback if this occurs?

@ds00424
Copy link

ds00424 commented Jan 19, 2016

I am having similar issue.
Looks like Yahoo is returning a Service Unavailable message at the moment.
I assume this is the trigger for the problem.

Query:
https://query.yahooapis.com/v1/public/yql?format=json&rnd=20160214&diagnostics=true&callback=jQuery211031334247775704394_1453233474635&q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.placefinder%20where%20text=%2207722%22%20and%20gflags=%22R%22%20limit%201)%20and%20u=%22f%22&_=1453233474636

Response:
/**/jQuery211031334247775704394_1453233474635({"query":{"count":0,"created":"2016-01-19T19:57:40Z","lang"
:"en-US","diagnostics":{"publiclyCallable":"true","url":{"execution-start-time":"1","execution-stop-time"
:"5","execution-time":"4","http-status-code":"503","http-status-message":"Service Unavailable","content"
:"http://gws2.maps.yahoo.com/findlocation?pf=1&locale=en_US&offset=15&flags=&q=07722&gflags=R&start=0
&count=100"},"user-time":"7","service-time":"4","build-version":"0.2.376"},"results":null}});

As noted in the issue report, neither the success nor the error callbacks are called.
HTH.

@felixdorner
Copy link

Same here...

@nickels55
Copy link

Same here - I tweeted @fleetingftw to make sure he is aware of the issue.

@rachelicha
Copy link

Same here. I also tweeted around an hour ago. Although based on ds00424's message, the error is potentially with Yahoo.

@ryotasolar
Copy link

how come the yahoo weather api is working fine but not with this?

@MuhammadSaleh
Copy link

same here !

@oasif
Copy link

oasif commented Jan 19, 2016

to fix edit jquery.simpleWeather.js
remove
and gflags="R" limit 1
from line 26

@MuhammadSaleh
Copy link

worked .. thanks @oasif

@ryotasolar
Copy link

wow that worked. I would of never guessed this. thanks @oasif

@conntagious
Copy link

Thanks @oasif!

@ctrlaltdylan
Copy link

Thank you @oasif !!!

Put the fix in a fork of the library and PR'd, although I'm not sure how to recreate the minified version.

https://github.com/ctrlaltdylan/jquery.simpleWeather

@ds00424
Copy link

ds00424 commented Jan 20, 2016

Thank you @oasif.
i don't know yql, but briefly looking at the docs, looks like gflags was previously used for geolocation using lat, lon. I guess something changed very recently to remove gflags. "Service Unavailable" from yql was a bit misleading.
i am not sure why the weather yql was using it in the first place (didn't look necessary for zip code lookup).
Did the "limit 1" have any effect? Leaving it in seemed ok as well. Although in some brief testing with yql console, I never got multiple results.

This fix ought to be included in v3.0.3.
Also a call to the error callback on this type of condition in the future.

@supervitas
Copy link

Removing
and gflags="R" limit 1
from line 26
bring me to [Object Object] . Error: "City not found".

@DougHayward
Copy link

Same issue as VitalyNikolaev here...

@genericuser256
Copy link

@VitalyNikolaev I was having the same problem. I fixed it by adding [0] to the end of data.query.results.channel on line 38 or leaving the limit 1 in on line 26

@fleeting
Copy link
Member

limit 1 is encouraged to leave as is due to several places returning multiple locations.

@genericuser256
Copy link

I've now started having problems again using geolocation, it seems like using city works but not lat and long. Can anyone else test and confirm this?

@supervitas
Copy link

Yes, and solutions above, dosent solve the problem

@genericuser256
Copy link

@VitalyNikolaev It's weird because it seemed to last night and when I wrote my last post...?

@oasif
Copy link

oasif commented Jan 20, 2016

The following line 26 should work with zip code:
weatherUrl += 'select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="'+options.location+'") and u="'+options.unit+'"';

@genericuser256
Copy link

I (and I believe a few other people) are wanting to use the lat and long (as we can easily get it dynamically) so zip codes etc. don't work as well

@fleeting
Copy link
Member

Correct, currently it's the lat/long that is causing the issue. Yahoo's API is reporting service unavailable on looking up location data using lat/long. Removing the gflags="R" will give a temporary work around for zip code and city, state in the location param. The gflags is there just to do a reverse lookup when querying with lat/long. I've verified using the examples Yahoo provides in their documentation that their reverse lat/long lookup is currently down. simpleWeather isn't the only script affected based on a quick stackoverflow search. The best solution is the temp fix of removing gflags if you are using zip code or city/state as location and hopefully Yahoo restores the reverse lookup API.

@genericuser256
Copy link

@fleeting Is there an official place to check the status of that part of the api so I can figure out when the service is back up?

@fleeting
Copy link
Member

@ascott23 Not that I'm aware of. Info and support from Yahoo regarding their APIs is rare. They post in their forums pretty rare and there are a few topics already open on it from other people about the issue (one, two). Their weather API went down a little while back and it took several days before it came back up with very little word from them besides on the uservoice page.

@genericuser256
Copy link

@fleeting Ok thanks!
I've found a work-around for now with google's API which gets the city and province names (for canada at least) here
Based off this stackoverflow post and using the docs here

@fleeting
Copy link
Member

Workarounds are always a pain but I'm going to finally look for a replacement API. Yahoo has been pretty unreliable the past six months, next to zero support/response, and generally lacks some weather data people ask for often. I've got a few I'll be checking out.

@genericuser256
Copy link

Keep up the awesome work!

@nickels55
Copy link

Thanks for the update and suggested fixes! @oasif suggestion about removing that code from line 26 worked for me.

@wmoore
Copy link

wmoore commented Jan 20, 2016

Here is a workaround that supports lat/lng and text locations.

Warning: The Weather Underground geolookup call returns a warning that it will be depreciated. This is a temporary workaround.

Replace line 26 with this -

if(options.location.match(/^([-+]?\d{1,2}([.]\d+)?),\s*([-+]?\d{1,3}([.]\d+)?)$/)) {
  weatherUrl += 'select * from weather.forecast where woeid in (select woeid from geo.placefinder where text in (select city from wunderground.geolookup where location="'+options.location+'" limit 1) limit 1) and u="'+options.unit+'"&env=store://datatables.org/alltableswithkeys';          
} else {
  weatherUrl += 'select * from weather.forecast where woeid in (select woeid from geo.placefinder where text="'+options.location+'" limit 1) and u="'+options.unit+'"';
}

@supervitas
Copy link

Thank you! Its worked for me!

@fleeting fleeting changed the title Throws error on geo.placefinder, doesn't display weather and doesn't catch error. simpleWeather is currently not working. Jan 29, 2016
@demonicinn
Copy link

not working

@fleeting fleeting reopened this Jan 29, 2016
@fleeting
Copy link
Member

I have released an update to simpleWeather that fixes the issue. If anybody cares to test it out on their own setup that would be great. I did some testing with the demos and didn't have any issues. The cdn copy is still pending the refresh so you will need to download the file from the repo directly.

Thanks to everybody who helped debug the issues and fixes. It turns out Yahoo has completely removed the geo.placefinder API point that I was using before (thanks for that Yahoo). It now uses geo.places. I'll leave this open for a day or two.

@Mikeysauce
Copy link

lol very weird that I'm in the process of updating my site when you push out this fix. Tried everything in the comments above to no avail but your fix immediately sorted it with a ctrl v. (ps this is with 5 different locations all pulling in using Lat/Long)

@fleeting fleeting added the bug label Jan 29, 2016
@fleeting fleeting self-assigned this Jan 29, 2016
@geerlingguy
Copy link

@fleeting - Thanks so much for the new release; I was just about to push up a patched version of the library when I noticed you published an update. It works great for my use case: use user geolocation coordinates, fallback to a specific woeid. Both work great, and I tested a few location names as well.

@ygalanter
Copy link

Was getting a more generic location than I wanted using the query above, so modified it slightly

@steintraci
Copy link

I still can't get mine to work, It won't update. With all of the conversations above, its hard to tell what exactly am I supposed to do about this? Do I can the whole thing and start over by uploading the new files or what? I cant follow what you are asking us to do?

@steintraci
Copy link

OOPS nevermind it works now :) ThANK YOU!

@tk1087
Copy link

tk1087 commented Feb 2, 2016

it stopped working for me again just about 20mins ago... it was working fine but now I see that it's broken even on this site.

@ghost
Copy link

ghost commented Feb 2, 2016

Same as @tk1087 . Very recently stopped working.

Uncaught TypeError: Cannot read property 'results' of undefined

@tk1087
Copy link

tk1087 commented Feb 2, 2016

and of course now it starts working again, it just fixed itself.

@fleeting
Copy link
Member

fleeting commented Feb 2, 2016

The demos are currently working for me so I would need to see some code or links to what isn't working to be of any hell.

@DukeBaird
Copy link
Author

Also working for me - Thanks for the fix

@ecdcrew
Copy link

ecdcrew commented Feb 6, 2016

The demos are currently working for me so I would need to see some code

$.simpleWeather({ location: 'Austin, Tx', ...... WORKS
$.simpleWeather({ location: 'Bridgetown, Barbados', ...... DOES NOT

Try in codepen

@steintraci
Copy link

We got it working….thanks.

On Feb 6, 2016, at 2:46 PM, ecdcrew notifications@github.com wrote:

The demos are currently working for me so I would need to see some code

$.simpleWeather({ location: 'Austin, Tx', ...... WORKS
$.simpleWeather({ location: 'Bridgetown, Barbados', ...... DOES NOT

Try in codepen


Reply to this email directly or view it on GitHub #174 (comment).

@ecdcrew
Copy link

ecdcrew commented Feb 6, 2016

Seems like international (non-us) weather is NOT working. So yours may be working, but international is not.

@andyades
Copy link

andyades commented Feb 6, 2016

Anyone else just lose it again? Getting the "THERE WAS A PROBLEM RETRIEVING THE LATEST WEATHER INFORMATION." in the codepen too.

@geerlingguy
Copy link

@andyades - Getting the same here, today. I wonder if it's just Yahoo being flaky again, or if they're changing their API yet again.

@steintraci
Copy link

That's great it's happening on mine too.

Sent from a telephone. Lol.

On Feb 6, 2016, at 3:47 PM, andyades notifications@github.com wrote:

Anyone else just lose it again? Getting the "THERE WAS A PROBLEM RETRIEVING THE LATEST WEATHER INFORMATION." in the codepen too.


Reply to this email directly or view it on GitHub.

@fleeting
Copy link
Member

fleeting commented Feb 6, 2016

Looks like Yahoo's weather API is down right now. Their YQL console is returning an error. https://developer.yahoo.com/yql/console/#h=select+*+from+weather.forecast+where+woeid%3D2367105

@fleeting
Copy link
Member

fleeting commented Feb 7, 2016

Yahoo's API seems to be back up and working. I'm closing this as the main issue in this thread has been fixed. Any other problems just create a new issue.

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

No branches or pull requests