0

Retrieve Yahoo! Weather info from multiple cities in one query

With the Yahoo! Finance CSV API, you can specify multiple symbols and retrieve them in one query like this:

select * from csv where url='http://download.finance.yahoo.com/d/quotes.csv?s=^n225,^hsi,^gdaxi,^fchi,^aex,^ftse,^dji,^ixic,^gspc&f=snl1c1p2pohgd1t1&e=.csv'

Does the Yahoo! Weather RSS API support this? E.g. specify multiple location codes. Or maybe is it possible in batch mode? I'm only aware of doing this:

select * from rss where url='http://weather.yahooapis.com/forecastrss?p=NLXX0002'

by
2 Replies
  • QUOTE (FocusFriend @ Apr 29 2009, 12:38 PM) <{POST_SNAPBACK}>
    With the Yahoo! Finance CSV API, you can specify multiple symbols and retrieve them in one query like this:

    select * from csv where url='http://download.finance.yahoo.com/d/quotes.csv?s=^n225,^hsi,^gdaxi,^fchi,^aex,^ftse,^dji,^ixic,^gspc&f=snl1c1p2pohgd1t1&e=.csv'

    Does the Yahoo! Weather RSS API support this? E.g. specify multiple location codes. Or maybe is it possible in batch mode? I'm only aware of doing this:

    select * from rss where url='http://weather.yahooapis.com/forecastrss?p=NLXX0002'



    You can use a sub-select to get the data from multiple locations

    CODE
    select * from weather.forecast where location in (90210, 94536, 94085)


    Or if you'd rather use the url that you choose,

    CODE
    select * from rss where url in ('http://weather.yahooapis.com/forecastrss?p=NLXX0002', 'http://weather.yahooapis.com/forecastrss?p=NLXX0....', ....)



    -- Nagesh
    0
  • Thx! I'm gonna use the 2nd one; works gr8.
    0

Recent Posts

in YQL