0

Canadian Zip codes with Weather RSS feed

I am using the weather rss feed in a web application the address is "http://weather.yahooapis.com/forecastrss?p=", it works great for US zip codes but when I pass a Canadian zip code like this one for Toronto "L5L 1J9" it errors out saying input string was not in correct format. How can I get this to work with Canadian zip codes?

Thanks!
Sam

by
0 Replies
  • Hi Sam,

    The issue here is that zip code use is for domestic (US) locations. The RSS feed for international locations (funny to think of Canada as international) uses location id's. If you go to a location on weather.yahoo.com in Canada I'll explain what I mean (here's one for instance: http://weather.yahoo.com/Abbotsford-Canada...1/forecast.html). In that URL you can see the location id of CAXX0001. This is what you will need to use to look up locations in Canada. There is not currently an automatic method I've found for looking up these country codes, but if there's a single location that you are searching for this should be easy to add it.

    I hope that helps.

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    Twitter: jcleblanc

    QUOTE (samcromer @ Jun 25 2009, 06:24 AM) <{POST_SNAPBACK}>
    I am using the weather rss feed in a web application the address is "http://weather.yahooapis.com/forecastrss?p=", it works great for US zip codes but when I pass a Canadian zip code like this one for Toronto "L5L 1J9" it errors out saying input string was not in correct format. How can I get this to work with Canadian zip codes?

    Thanks!
    Sam
    0

Recent Posts

in General Discussion at YDN