I\'m trying to get Yahoo! weather API with temperatures in Celsius.
I\'ve added &u=c
in the request, but it\'s still returning data in Fahrenheit.
Whenever I had to call a temperature that I wanted in Celsius I just used a simple conversion function:
function FtoC(temp) {return Math.round((temp - 32) / (9 / 5));}
Then again, I wanted to toggle between Fahrenheit and Celsius. Just calling the Celsius JSON element from Yahoo is probably better if all you want to use is Celsius.
I used the yql
select item from weather.forecast where woeid=22724447 and u='c'
and it worked fine with the results in Celsius. I changed the "LEXX0003" for the real WOEID of that zone and it seems to have worked.
Better late than never...
var locationQuery = escape("select item from weather.forecast where woeid in (select woeid from geo.places where text='GB-LND') and u='c'"),
locationUrl = "http://query.yahooapis.com/v1/public/yql?q=" + locationQuery + "&format=json&callback=?";
It's easier to read if you break it up. You we're pretty close, just needed the u=c as part of the query, not at the end of the url.