Fred,

  This is very interesting. Do you know what it does
under the covers? I'm just curious because I'm
currently getting trained in XML, and this seems like
exactly the type of thing that one uses XML for,
incorporating data from another site into your own. If
that's what this module really does, you could do the
same thing yourself with LWP, XML::Parser, and
probably a few other modules I'm not aware of off the
top of my head, but of course the module you mention
is much easier for the XML-uninitiated (as was I until
a few days ago).

   Or maybe it does something completely different? (I
guess I could get a copy and look at the source, but
I'm too lazy.)

   BTW, I'm assuming I got this through the Perl CGI
Beginners list, although the "To" field on my copy of
the message was blank, so I'm not really sure. At any
rate, hopefully they find it interesting.

- John

--- Fred Sahakian <[EMAIL PROTECTED]> wrote:
> I got this from a Perl list at Builder.com, I
> thought it would be interesting to share, something
> folks may want to include it on their web sites:
> 
> Retrieve weather data with Geo::WeatherNOAA 
> 
> Perl's WeatherNOAA module gives you easy access to
> current weather information and short-term forecasts
> provided by the National Oceanographic and
> Atmospheric Administration (NOAA). 
> The module exports a handful of functions to
> retrieve and process weather data. The simplest
> interface uses the print_forecast( ) and
> print_current( ) functions. These functions have
> default values for all parameters except the city
> and state, which makes them very easy to use. 
> Here's a simple script that will print the forecast
> and current conditions for a selected city and state
> (with a default of Louisville, KY). 
> use Geo::WeatherNOAA;
> 
> $city = shift || 'Louisville';
> $state = shift || 'KY';
> 
> print "Reading weather data for $city, $state ...
> \n";
> 
> print "Forecast: " . print_forecast($city, $state);
> print "\nCurrent: " . print_current($city, $state); 
> If you know the city and state that you want weather
> information for, you can print the forecast right
> from the command line as follows: 
> perl -MGeo::WeatherNOAA -e "print
> print_forecast('Louisville', 'KY'); 
> The WeatherNOAA module makes it extremely easy to
> get current weather conditions and forecast data for
> display on a Web page, a mobile device, or simply
> for viewing at the console. 
> 


=====
"Now it's over, I'm dead, and I haven't done anything that I want; or, I'm still 
alive, and there's nothing I want to do." - They Might Be Giants, http://www.tmbg.com

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to