Skip to content
This repository has been archived by the owner. It is now read-only.

simpleWeather is currently not working. #174

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

Comments

Projects
None yet
@DukeBaird
Copy link

DukeBaird commented Jan 19, 2016

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

felixdorner commented Jan 19, 2016

Same here...

@nickels55

This comment has been minimized.

Copy link

nickels55 commented Jan 19, 2016

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

@rachelicha

This comment has been minimized.

Copy link

rachelicha commented Jan 19, 2016

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

@ryotasolar

This comment has been minimized.

Copy link

ryotasolar commented Jan 19, 2016

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

@MuhammadSaleh

This comment has been minimized.

Copy link

MuhammadSaleh commented Jan 19, 2016

same here !

@oasif

This comment has been minimized.

Copy link

oasif commented Jan 19, 2016

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

@MuhammadSaleh

This comment has been minimized.

Copy link

MuhammadSaleh commented Jan 19, 2016

worked .. thanks @oasif

@ryotasolar

This comment has been minimized.

Copy link

ryotasolar commented Jan 19, 2016

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

@conntagious

This comment has been minimized.

Copy link

conntagious commented Jan 19, 2016

Thanks @oasif!

@ctrlaltdylan

This comment has been minimized.

Copy link

ctrlaltdylan commented Jan 20, 2016

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

supervitas commented Jan 20, 2016

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

@BonnieDoug

This comment has been minimized.

Copy link

BonnieDoug commented Jan 20, 2016

Same issue as VitalyNikolaev here...

@genericuser256

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

@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

This comment has been minimized.

Copy link
Member

fleeting commented Jan 20, 2016

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

@genericuser256

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

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

This comment has been minimized.

Copy link

supervitas commented Jan 20, 2016

Yes, and solutions above, dosent solve the problem

@genericuser256

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

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

@oasif

This comment has been minimized.

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

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

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

This comment has been minimized.

Copy link
Member

fleeting commented Jan 20, 2016

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

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

@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

This comment has been minimized.

Copy link
Member

fleeting commented Jan 20, 2016

@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

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

@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

This comment has been minimized.

Copy link
Member

fleeting commented Jan 20, 2016

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

This comment has been minimized.

Copy link

genericuser256 commented Jan 20, 2016

Keep up the awesome work!

@nickels55

This comment has been minimized.

Copy link

nickels55 commented Jan 20, 2016

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

@wmoore

This comment has been minimized.

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

This comment has been minimized.

Copy link

supervitas commented Jan 20, 2016

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

This comment has been minimized.

Copy link

demonicinn commented Jan 29, 2016

not working

@fleeting fleeting closed this in 59e0ce5 Jan 29, 2016

@fleeting fleeting reopened this Jan 29, 2016

@fleeting

This comment has been minimized.

Copy link
Member

fleeting commented Jan 29, 2016

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

This comment has been minimized.

Copy link

Mikeysauce commented Jan 29, 2016

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

This comment has been minimized.

Copy link

geerlingguy commented Jan 29, 2016

@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

This comment has been minimized.

Copy link

ygalanter commented Jan 29, 2016

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

@steintraci

This comment has been minimized.

Copy link

steintraci commented Feb 1, 2016

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

This comment has been minimized.

Copy link

steintraci commented Feb 1, 2016

OOPS nevermind it works now :) ThANK YOU!

@tk1087

This comment has been minimized.

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

This comment has been minimized.

Copy link

ghost commented Feb 2, 2016

Same as @tk1087 . Very recently stopped working.

Uncaught TypeError: Cannot read property 'results' of undefined

@tk1087

This comment has been minimized.

Copy link

tk1087 commented Feb 2, 2016

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

@fleeting

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

DukeBaird commented Feb 2, 2016

Also working for me - Thanks for the fix

@ecdcrew

This comment has been minimized.

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

This comment has been minimized.

Copy link

steintraci commented Feb 6, 2016

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

geerlingguy commented Feb 6, 2016

@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

This comment has been minimized.

Copy link

steintraci commented Feb 6, 2016

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

This comment has been minimized.

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

This comment has been minimized.

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.
You can’t perform that action at this time.