Yahoo Query Language (YQL)... Location ID vs WOEID for International Weather

UPDATED BELOW

 

OK - so I just started messing about with YQL on the Yahoo developer site, using the YQL console which is pretty awesome - it allows you to use a SQL variant to query the vast XML data sources.

I am interested in weather - in Canada, specifically.  Which sucks - because the weather part of the API is tuned to zip codes (US only), and even the RSS feed for Canadian locations use some other proprietary location code.  For example, here is the RSS for weather in Toronto:  http://xml.weather.yahoo.com/forecastrss?p=CAXX0504&u=c.

Why doesn't this use the WOEID (where on earth id) which is returned from THIS call in YQL:

image

 

But you can't use that WOEID to get the weather - you need a zip code or a location id.  That stinks.  The call below works (somewhat) but it is somewhat insufficient, if you ask me.

 

image

This whole thing is a bit half baked unless they add WOEID support to everything (maybe they did and I missed it...).

YQL is pretty awesome, but I think it needs work.

 

more 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 can do this:

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

Notice the external URL that we are calling to resolve the location ID?  NICE!  I take it all back.

1 Comment

Comments have been disabled for this content.