For Android application is very useful to receive data in json format and for example submitting select item from weather.forecast where woeid=2502265 in yahoo yql console, retrieve all the useful data for my weather android app project. But it would be nice to get that data in Celsius degree and in Spanish language. How could I get that?
2 Answers
Going over the yahoo weather API response documentation:
Note that the default RSS feed uses Fahrenheit degree units and English units for all other attributes (miles, pounds per square inch, miles per hour). If Celsius has been specified as the degree units for the feed (using the u request parameter), all the units are in metric format (Celsius, kilometers, millibars, kilometers per hour).
So, you can specify the unit to be Celsius:
u Units for temperature (case sensitive)
f: Fahrenheit
c: Celsius u=c
Source: https://developer.yahoo.com/weather/#request
So, use an AND u='c'
, I guess, in your query
Now, you can translate your data using this answer https://stackoverflow.com/questions/17056168/google-translate-or-similar-api-for-android

- 1
- 1

- 24,612
- 35
- 133
- 221
-
using *AND u=c* gives this error *Invalid identfier c. me AND me.ip are the only supported identifier in this context* :-/ – JoeCoolman Jun 25 '14 at 05:06
-
@JoeCoolman link me to the documentation you are referring to :) – An SO User Jun 25 '14 at 05:23
-
the only parameters that you can add in your query are listed here https://developer.yahoo.com/yql/guide/yql_url.html#yql-query-parameters, *u* is not in that list – JoeCoolman Jun 25 '14 at 05:45
-
@JoeCoolman Then you will have to convert `F` to `C` yourself. It is just one line of code. Not too hard. :) – An SO User Jun 25 '14 at 05:49
-
Lazy yahoo api developers I guess. Yes, this units conversion is a common exercise for beginners in programming >:-| I'll do it. – JoeCoolman Jun 25 '14 at 05:57
-
@JoeCoolman you mentioned Yahoo! Weather API whose documentation I read before posting the answer. It **does** have the option to specify what units you want. – An SO User Jun 25 '14 at 06:09
I've solved my question only about the units, Yahoo is not providing rss weather in other language than English-US :-( . This solution avoids to make code for units conversion for distance, speed, temperature and pressure. Check my example query out.

- 512
- 3
- 8
- 27