Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Checking the Weather

by bfdi533 (Friar)
on Mar 21, 2006 at 17:32 UTC ( [id://538238]=note: print w/replies, xml ) Need Help??


in reply to Checking the Weather

Another alternative to get text-based info is to use Weather::Simple. Here is an example that uses Weather::Simple for Tupper Lake, NY. It returns a hash that has all the info you need.

#!/usr/bin/perl use Data::Dumper; use Weather::Simple; # define parameters for weather search my %params = ( 'cache' => '/tmp/weathercache', 'partner_id' => 'somepartnerid', 'license' => '12345678', 'place' => 'Tupper Lake, NY', ); # instantiate a new weather.com object my $simple_weather = Weather::Simple->new(%params); my $weather = $simple_weather->get_weather(); print Dumper($weather);

Update: Fixed a comment in the code above that would prevent it from retrieving the Tupper Lake weather.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://538238]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2025-07-17 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.