Skip to content

Commit

Permalink
Merge pull request #5 from waynieack/WeatherNOAA
Browse files Browse the repository at this point in the history
Fixes for broken code due to NOAA site changes. Bug hollie#631
  • Loading branch information
Wayne Gatlin authored Oct 22, 2016
2 parents b9cfac0 + 0226bad commit 053bdef
Show file tree
Hide file tree
Showing 2 changed files with 620 additions and 507 deletions.
12 changes: 5 additions & 7 deletions bin/get_weather
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Usage:
-city xxx => xxx is the City you want.
-state xxx => xxx is the State you want.
-zone xxx => xxx is the Zone (for forecast) you want.
-data xxx => xxx is either conditions, forecast, or all. Default is all.
Expand All @@ -76,10 +75,9 @@ eof
my ( $conditions, $forecast, %data );
my %config_parms;

$parms{city} = 'Rochester' unless $parms{city};
$parms{zone} = $parms{city} unless $parms{zone};
$parms{state} = 'MN' unless $parms{state};
$parms{data} = 'all' unless $parms{data};
$parms{city} = 'Rochester' unless $parms{city};
$parms{state} = 'MN' unless $parms{state};
$parms{data} = 'all' unless $parms{data};
$data{conditions}++ if $parms{data} eq 'all' or $parms{data} eq 'conditions';
$data{forecast}++ if $parms{data} eq 'all' or $parms{data} eq 'forecast';

Expand Down Expand Up @@ -110,9 +108,9 @@ if ( $data{conditions} ) {
}

if ( $data{forecast} ) {
print "Getting the forecast for $parms{zone}, $parms{state}\n";
print "Getting the forecast for $parms{city}, $parms{state}\n";
$forecast =
print_forecast( $parms{zone}, $parms{state}, undef, undef, undef, 1 );
print_forecast( $parms{city}, $parms{state}, undef, undef, undef, 1 );
$forecast =~ s/Geo::WeatherNOAA.pm .+\n//; # Drop geo version
#$forecast =~ s/\.\.\./\. /g;
$forecast =~ s/(\()(EDT|EST|CDT|CST|MDT|MST|PDT|PST)(\) *)//g;
Expand Down
Loading

0 comments on commit 053bdef

Please sign in to comment.