Fog Creek Software
Discussion Board




Weather data sources

I want to make an app that shows the current weather on the planet (temperature, rain, wind, etc.) Is there any standard or spec for getting at the data online?

I could just write a script to mine it from weather.com, but I figure there might be a cleaner way.

Ideas?

xyz
Tuesday, September 23, 2003

I've used the weather server at Unisys for just this - they pull it from NOAA and the national weather service and make it available in handy-dandy xml.

For example, for my zip code:
http://www.weather.unisys.com/forexml.cgi?30605

I think you can pass in city codes that are the weather stations, but I'm not sure where to get that list of the top of my head.  Example:

http://www.weather.unisys.com/forexml.cgi?KAHN

Jon
Tuesday, September 23, 2003

There are some nice perl modules for getting weather data from online sources like: http://search.cpan.org/author/MNAGUIB/Weather-Underground-2.10/Underground.pm

Matthew Lock
Tuesday, September 23, 2003

Here is a simple tutorial on how to extract the XML weather data using Java from the Unisys weather site.

http://www-106.ibm.com/developerworks/java/library/j-xmljava/

BTW, I use the Unisys weather site to find out the latitude/longitude/time zone for a given location (so I can calculate the sunset times).

Unfortunately, its time zone data is inaccurate for many locations.

A.F.

Avrom Finkelstein
Wednesday, September 24, 2003

Avrom, the data I got included sunrise and sunset times. Maybe it's a new feature?

!El gato es muy gordo!
Wednesday, September 24, 2003

No, it is not a new feature.

For starters, the sunrise/sunset only applies for US/Canada locales. It does not apply to anything else outside that area.

Secondly, the sunrise/sunset information is current information, i.e. it reports today's sunrise/sunset. I need to calculate the sunrise/sunset for *any* date.

Thus, for my purposes, I need the lattitude/longitude/time zone. Unfortunately, the time zone is off by an hour for many locations and really annoys me. I have been looking for an alternative site that returns XML based data with accurate time zones for any location worldwide. So far, I haven't had much success. If I could find some code that can calculate the time zone based on the latitude/longitude that would be great.

See http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=60342 for my previous inquiry into this.

A.F.

Avrom Finkelstein
Wednesday, September 24, 2003

I was wrong in one regard.

It does return sunrise/sunset for any location.

Another thing it does do... it does lookup by airport code (in addition to place name and US zip code).

So, if you do a lookup for "YYZ" that should return Toronto's Pearson airport.

A.F.

Avrom Finkelstein
Wednesday, September 24, 2003

*  Recent Topics

*  Fog Creek Home