by spongebob » Mon Jan 11, 2010 8:17 am
I've got some solutions for you:
1) Using the weather.com, for each city + state (or country), query http://xoap.weather.com/search/search?where=CITY,STATE_OR_COUNTRY => XML answer with int'l weather code, but you can have dupes for similar names.
2) Using flickr/yahoo: http://api.flickr.com/services/rest/?method=flickr.places.findByLatLon&api_key=...&lat=LATITUDE&lon=LONGITUDE&api_sig=...
You'll get an XML answer, with and where on earth ID (WOEID), then query yahoo on http://weather.yahooapis.com/forecastrss?w=WOEID you'll get a RSS answer with the international code in the <guid> node.
3) Using geonames: http://ws.geonames.org/findNearByWeatherXML?lat=LATITUDE&lng=LONGITUDE => you'll get a weather station code, but it's only airport weather station code, so it's less precise
4) Using google, but I don't understand how their reverse geocoding api works.
This is a bunch of requests to make, but, at least you'll get something very precise. Using XPath it's a matter of writing the right rule (I've done this already, so please PM me, I could share with you), and then, it's a batch script to run.
At least a city based precision would be a great, great step forward.