diff --git a/code/common/internet_weather.pl b/code/common/internet_weather.pl index 3c8afde7b..858303352 100644 --- a/code/common/internet_weather.pl +++ b/code/common/internet_weather.pl @@ -80,7 +80,7 @@ sub normalize_conditions { if ( said $v_get_internet_weather_data) { if (&net_connect_check) { set $p_weather_data - qq|get_weather -state $config_parms{state} -city "$config_parms{city}"|; + qq|get_weather -state $config_parms{state} -city "$config_parms{city}" -nws_rwr_zone $config_parms{nws_rwr_zone}|; start $p_weather_data; $v_get_internet_weather_data->respond( "app=weather Weather data requested for $config_parms{city}, $config_parms{state}" @@ -97,7 +97,7 @@ sub normalize_conditions { if ( said $v_get_internet_weather_conditions) { if (&net_connect_check) { set $p_weather_conditions - qq|get_weather -state $config_parms{state} -city "$config_parms{city}" -data conditions|; + qq|get_weather -state $config_parms{state} -city "$config_parms{city}" -data conditions -nws_rwr_zone $config_parms{nws_rwr_zone}|; start $p_weather_conditions; $v_get_internet_weather_conditions->respond( "app=weather Weather conditions requested for $config_parms{city}, $config_parms{state}" diff --git a/lib/site/Geo/WeatherNOAA.pm b/lib/site/Geo/WeatherNOAA.pm index 57d29170f..caf4f9fb6 100644 --- a/lib/site/Geo/WeatherNOAA.pm +++ b/lib/site/Geo/WeatherNOAA.pm @@ -480,8 +480,7 @@ sub ucfirst_words { ######################################################################### sub get_city_hourly { - my ( $city, $state, $filename, $fileopt, $UA ) = @_; - + my ( $city, $state, $filename, $fileopt, $UA, $rwrzone ) = @_; # City and state in all caps please # $city = uc $city; @@ -493,11 +492,12 @@ sub get_city_hourly { # Get data # my $zone = &get_zone( $ZONE_SEARCH_URL, "$city, $state" ); + $rwrzone = $zone unless length($rwrzone); my $URL = $URL_BASE . $zone . '&issuedby=' - . $zone + . $rwrzone . '&product=RWR&format=txt&version=1&glossary=0'; #print STDERR "Getting data from $URL\n"; @@ -514,7 +514,14 @@ sub get_city_hourly { $data = get_data( $URL, $filename, $fileopt, $UA ); $datalength = length($data); } - + if ( $data =~ /None issued/ ) { + print " + NWS is not returing any information, please configure the 2 or 3 letter zone + in the mh.private.ini with the nws_rwr_zone option. IE: nws_rwr_zone=LIX + The zone can be found at the following site: + http://forecast.weather.gov/product_sites.php?site=$zone&product=RWR\n + "; + } #print STDERR "Got data ($datalength)\n"; # Return error if there's an error @@ -598,14 +605,14 @@ sub get_city_hourly { } # get_city_hourly() sub print_current { - my ( $city, $state, $filename, $fileopt, $UA ) = @_; - my $in = process_city_hourly( $city, $state, $filename, $fileopt, $UA ); + my ( $city, $state, $filename, $fileopt, $UA, $rwrzone ) = @_; + my $in = process_city_hourly( $city, $state, $filename, $fileopt, $UA, $rwrzone ); return wrap( '', ' ', $in ); } sub process_city_hourly { - my ( $city, $state, $filename, $fileopt, $UA ) = @_; - my $in = get_city_hourly( $city, $state, $filename, $fileopt, $UA ); + my ( $city, $state, $filename, $fileopt, $UA, $rwrzone ) = @_; + my $in = get_city_hourly( $city, $state, $filename, $fileopt, $UA, $rwrzone ); $state = uc($state);