Skip to content

Commit

Permalink
Fixes for broken code due to NOAA site changes. Zone is no longer nee…
Browse files Browse the repository at this point in the history
…ded when get_weather is called. Bug hollie#631
  • Loading branch information
waynieack committed Oct 22, 2016
1 parent 25f79ee commit 0226bad
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 0226bad

Please sign in to comment.