Weather-Underground-StationHistory

 view release on metacpan or  search on metacpan

lib/Weather/Underground/StationHistory.pm  view on Meta::CPAN

            'http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=%s&year=%d&month=%d&day=%d&graphspan=day&format=1',
            $station_id,
            $year,
            $month_number,
            $day_of_month,
        ;
} # end generate_single_day_station_history_url()

sub strip_garbage_from_station_history {
    my $original_contents   = shift;
    my @original_lines      = split m/ [\r\n]+ /xms, $original_contents;
    my $resulting_contents  = $EMPTY_STRING;

    foreach my $original_line (@original_lines) {
        $original_line =~ s/ $RE{balanced}{-parens => '<>'} //xmsg;
        $original_line =~ s/ $RE{ws}{crop}                  //xmsg;

        if ($original_line ne $EMPTY_STRING) {
            $resulting_contents .= "$original_line\n";
        } # end if
    } # end foreach



( run in 0.660 second using v1.01-cache-2.11-cpan-71847e10f99 )