Jonathans stuff RSS Feed
 
 
 
 

Mixing and matching (weather) services and data using YQL

Some recent discussion about the weather.forecast table lead to a really great example of mixing Yahoo and external services together.

The original poster wanted to get the forecast from the weather.forecast table for a non-US location. The table itself represents these types of location using a special key. For example, Prague (Czech Republic) is EZXX0012.

A followup post indicate that weather.com has a service that actually turns text-based locations (like “Prague”) into a list of possible location IDs that are suitable for the forecast table:

http://xoap.weather.com/search/search?where=prague

So now we have a great “join” situation, we can use one web service to join data in another completely different service and get the result we want for the inputs we have! So to get weather for all “prague”s in the world like this in YQL its a simple sub-select:

select * from weather.forecast where location in
   (select id from xml where
    url="http://xoap.weather.com/search/search?where=prague"
    and itemPath="search.loc")

You can see YQL run this query in the console (you’ll need a Yahoo! login to get to the page).

5 Responses to “Mixing and matching (weather) services and data using YQL”

  1. 1
    Joel Varty:

    Great, great post!

    Living in Canada, and developing for Canadians, this makes me a little more comfortable. For the location search, to, how can we limit the results to more than just city? Is there an API reference for that weather.com service?\

    Thanks for helping!

  2. 2
    Yahoo Query Language (YQL)... Location ID vs WOEID for International Weather - Joel Varty:

    [...] later – joel UPDATE: Ok – I kept digging and found this blog entry by Jonathan Trevor – whom I presume is a developer involved with Yahoo.  It shows us that we [...]

  3. 3
    Orlando Kachermeyer:

    So, this post was a good read!

  4. 4
    Zachary Evans:

    I always like Sunny weather and disliked gloomy rainy weather..*”

  5. 5
    Mason Adams:

    the weather these days is hotter than the previous decades, i guess it is the effect of global warming.`,

Leave a Reply

Categories

Archives



Blogroll

Meta

 Subscribe in a reader