Suppose you desire to get the weather for the Rio Janeiro city, in Rio Janeiro state, in Brazil.
The Yahoo's weather web services requires the WOEID.
To discover the WOEID, do:
1. Point your browser to:
http://weather.yahoo.com/brazil/
or
http://weather.yahooapis.com/forecastrss?w=455825
In the "search box" type the text below and press 'Go':
Rio de Janeiro, RJ, Brazil
After the page is redirected, the WOEID is shown in its URL as a number at the end:
http://weather.yahoo.com/brazil/rio-de-janeiro/rio-de-janeiro-455825/
Use this number to call the web service as follow:
http://weather.yahooapis.com/forecastrss?w=455825
You can use the URL directly on the browser or programatically.
If desired to get the temperature in Celsius degrees, append to the end of the url the following:
&u=c
No comments:
Post a Comment