0

Retrieving location ID from City, State, and Country?

Hello,

I'm making an app that will display a five day weather forecast in an image. A PHP script/geolocation tool loads the user's city, state (or province), and country, gets the weather, and renders it to the image. I retrieve the weather data from this RSS feed:

http://xml.weather.yahoo.com/forecastrss/USIL0225_f.xml (that's the one for Chicago)

I notice that Yahoo! Weather/Weather.com uses these location IDs, but I haven't been able to find a way to actually retrieve it. I notice that there are abbreviations for country, state, and then comes the zip code, and then Fahrenheit/Celsius measurement. However, since ZIP codes cover such a broad area, I would like it to be more specific for smaller cities/towns.

I could use a ZIP code, but this must work for international users. Let's say it tracks a user from Paris; zip codes won't work then, so I have to use location IDs. This is the one for Paris:

FRXX0076

But how world would I obtain that from a city/country? Is there some chart or database online that I could download and include in the script?

Thanks!

by
1 Reply
  • Hi John - I added a reply for this one in your other thread.

    - Jon

    QUOTE (john1704 @ Aug 22 2009, 10:37 AM) <{POST_SNAPBACK}>
    Hello,

    I'm making an app that will display a five day weather forecast in an image. A PHP script/geolocation tool loads the user's city, state (or province), and country, gets the weather, and renders it to the image. I retrieve the weather data from this RSS feed:

    http://xml.weather.yahoo.com/forecastrss/USIL0225_f.xml (that's the one for Chicago)

    I notice that Yahoo! Weather/Weather.com uses these location IDs, but I haven't been able to find a way to actually retrieve it. I notice that there are abbreviations for country, state, and then comes the zip code, and then Fahrenheit/Celsius measurement. However, since ZIP codes cover such a broad area, I would like it to be more specific for smaller cities/towns.

    I could use a ZIP code, but this must work for international users. Let's say it tracks a user from Paris; zip codes won't work then, so I have to use location IDs. This is the one for Paris:

    FRXX0076

    But how world would I obtain that from a city/country? Is there some chart or database online that I could download and include in the script?

    Thanks!
    0
  • QUOTE (Jon @ Aug 26 2009, 09:35 AM) <{POST_SNAPBACK}>
    Hi John - I added a reply for this one in your other thread.

    - Jon


    Hello there weather man
    Here below are all the city's you can use, and not more..

    http://weather.yahoo.com/France/FRXX/regional.html

    Good luck..
    0

Recent Posts

in General Discussion at YDN