Weather::GooglePerl interface to Google's Weather API | |
Download |
Weather::Google Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Daniel LeWarne
- Publisher web site:
- http://search.cpan.org/~possum/
Weather::Google Tags
Weather::Google Description
Perl interface to Google's Weather API Weather::Google is a Perl interface to Google's Weather API.SYNOPSIS use Weather::Google; # If you plan on using locations with non-ASCII characters use encoding 'utf8'; my $gw; ## Initialize the module $gw = new Weather::Google(90210); # Zip code $gw = new Weather::Google('Beverly Hills, CA'); # City name # Or $gw = new Weather::Google; $gw->zip(90210); # Zip code $gw->city('Beverly Hills, CA'); # City name ## Get some current information my @info; @info = $gw->current('temp_f','temp_c','humidity','wind_condition'); # Or my $current = $gw->current; @info = ($current->{temp_f}, $current->{temp_c}, $current->{humidity}); # Or @info = ($gw->temp_f, $gw->temp_c, $gw->humidity, $gw->wind_condition); ## Forecast print "Today's high: ", $gw->forecast(0,'high'); print "Today's high: ", $gw->forecast('Today','high'); print "Today's high: ", $gw->today('high'); # Assuming Today is Monday: print "Tomorrow's high: ", $gw->forecast(1,'high'); print "Tomorrow's high: ", $gw->forecast('Tue','high'); print "Tomorrow's high: ", $gw->tue('high'); ## Forecast information: print "Forecast for ". $gw->info('city'). "made at ". $gw->info('current_date_time'); Requirements: · Perl
Weather::Google Related Software