[oak perl] weather reports with perl

George Woolley george at metaart.org
Sat Jan 17 01:13:25 CST 2004


Elijah,
Well, it was encouraging to learn 
that someone, i.e. John, was 
actually using the weather cgi link on the Oakland.pm home page.
And he had an actual suggestion for an enhancement,
i.e, including the current temperature.
Wonder of wonders.

Yep, just plain old scraping.
I'm kind of surprised it hasn't broken yet.

Thanks for alerting me to so many modules
that address the problem.

John's suggestion 
and, more immediately, all the module alternatives,
inspired me to do something.
It turned out that the page I was scraping
had the desired information and more.
So it was simple to scrape some more.

But it would be kooler and more robust
to use a module and not scrape.
Perhaps given the info you've provided
as a starting point
someone would like to do that.
The cgi currently being used is on my personal site.
Easiest for me as Oakland.pm webmaster is 
if whoever does that (if anyone does)
puts the cgi on their personal site,
linkable to from Oakland.pm.

George

On Friday 16 January 2004 5:33 pm, B. E. G. wrote:
> 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
> _______________________________________________
> Oakland mailing list
> Oakland at mail.pm.org
> http://mail.pm.org/mailman/listinfo/oakland




More information about the Oakland mailing list