Saturday, June 15, 2013

How to use Yahoo web services for any country


 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

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...