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

Cities with apostrophes in the name don't work. #19

Open
nonissue opened this issue Jul 13, 2015 · 3 comments
Open

Cities with apostrophes in the name don't work. #19

nonissue opened this issue Jul 13, 2015 · 3 comments

Comments

@nonissue
Copy link

I'm currently in a Canadian city ("St. John's, Newfoundland") and though my location is detected successfully, I consistently get an error saying "Are you connected to the internet?". I've tested it by setting location to static and putting in other cities with apostrophes in their names, and they also fail. I'd like to add this works where I normally live as well.

@nonissue
Copy link
Author

Double escaping apostrophes in the YQL query seems to resolve the location issue, but afterwards, the units function stops working and defaults to F. I'm sure it's to do with the apostrophes but I don't really know enough to debug it. If you just want it to work and have this issue:

Insert on line 91:

city   = city.replace(/'/g, "\\'");

and then if you want celsius, replace the current query with:

"where location='"+city+", "+region+"' and unit='c'";

A total hack, but it works for me.

@felixhageloh
Copy link
Owner

That's annoying ... I also just tried https://weather.yahoo.com. When you start typing "St. John's"
you get the autocomplete suggestion "St. John's, NL, CA" and if you select it, everything works fine.
However if you type/paste that exact string and search, it won't find anything.
So it sounds like an issue with yahoo weather - great that you found a workaround!

@nonissue
Copy link
Author

I think it is maybe a bug with YQL and non-US cities. I played around with their YQL test console and the results were inconsistent. I might have another look at it, though I don't know it matters.

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

2 participants