Subject: | NOAA changed server name on Jan 23, 2007 |
Date: | Sun, 10 Jun 2007 00:00:33 +0200 |
To: | bug-Geo-WeatherNWS [...] rt.cpan.org |
From: | Guenter Knauf <info [...] gknw.de> |
Hi Marc,
it seems that for ftp the weather.noaa.gov server has changed its name to tgftp.nws.noaa.gov;
see also forum post from hajo:
http://www.cpanforum.com/posts/4181
Here's a patch:
--- WeatherNWS.pm.orig Sun Feb 09 19:57:32 2003
+++ WeatherNWS.pm Sat Jun 09 23:56:16 2007
@@ -36,7 +36,7 @@
my $Class=ref($Proto) || $Proto;
my $Self={};
- $Self->{servername}="weather.noaa.gov";
+ $Self->{servername}="tgftp.nws.noaa.gov";
$Self->{username}="anonymous";
$Self->{password}='weather@cpan.org';
$Self->{directory}="/data/observations/metar/stations";
thanks, Guenter.
--- WeatherNWS.pm.orig Sun Feb 09 19:57:32 2003
+++ WeatherNWS.pm Sat Jun 09 21:12:04 2007
@@ -36,7 +36,7 @@
my $Class=ref($Proto) || $Proto;
my $Self={};
- $Self->{servername}="weather.noaa.gov";
+ $Self->{servername}="tgftp.nws.noaa.gov";
$Self->{username}="anonymous";
$Self->{password}='weather@cpan.org';
$Self->{directory}="/data/observations/metar/stations";
@@ -268,6 +268,9 @@
if (($Line =~ /^([A-Z][A-Z][A-Z][A-Z])/) && ($Line ne "AUTO"))
{
$Self->{code}="$Line";
+ if (!$Self->{station}) {
+ $Self->{station}="$Line";
+ }
}
#------------------------------------------------------------------------------
@@ -278,6 +281,7 @@
{
my $Timez=substr($Line,2,4);
$Self->{time}="$Timez";
+ $Self->{time_sep}=substr($Timez,0,2).":".substr($Timez,2,2);
$Self->{day}=substr($Line,0,2);
}
@@ -940,7 +944,7 @@
you end up having to re-code your parsing program. With the weather module,
all you need is a four-letter station code to get the most recent weather
observations. If you do not know what the station code is for your area,
- check the site at http://205.156.54.206/oso/siteloc.shtml to start your
+ check the site at https://pilotweb.nas.faa.gov/qryhtml/icao/ to start your
search.
Since this module uses the NWS METAR Observations, you can get weather