[oak perl] weather reports with perl

B. E. G. oaklandpm at eli.users.panix.com
Fri Jan 16 19:33:36 CST 2004


At the last meeting there was a bit of discussion about putting
weather reports on webpages. George said he was using screen
scraping techniques to get it, I said that I knew of other
programs that get weather reports.

Turns out there are several perl modules on or listed at CPAN
that fetch weather reports:

Geo::Weather -- gets weather from weather.com

Weather::Underground -- gets weather from wunderground.com

Geo::METAR -- parses National Weather Service (NWS) reports (seems
	to be aimed at pilots)

Geo::WeatherNWS -- fetch and parse NWS reports

The tricky part of NWS seems to be figuring out your local station,
which is identified with a four letter string. Oakland Airport goes
by 'KOAK'.

Geo::WeatherNOAA -- fetch and print IWIN weather from NOAA (uses
	city/state as identifier). IWIN warns that it is going to
	be replaced soon, though:

	http://iwin.nws.noaa.gov/iwin/ca/zone.html
	http://weather.gov/inlr.html

I played with three of these, Geo::Weather, Geo::WeatherNWS, and
Geo::WeatherNOAA. Geo::WeatherNWS seemed the most interesting. The
Geo::WeatherNOAA one promised lots of information, but delivered
little. Actual test and response:

$ perl -MGeo::WeatherNOAA -e 'print process_city_hourly("Oakland",
	"CA", "", "get");'
At 5:00 PM, Oakland City, CA conditions were N/A at  53°F, wind was
at  mph.  The relative humidity was  MM%.

Elijah



More information about the Oakland mailing list