blob: 9c1411eae493a50352d97ceeb2240fece69d6380 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
--- GrabWeather.orig 2009-01-11 18:15:02 UTC
+++ GrabWeather
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# Grabs the latest local weather conditions from the
@@ -12,7 +12,7 @@
$ReportDir = '.wmWeatherReports';
#$WeatherSrc = 'ftp://weather.noaa.gov/data/observations/metar/decoded';
-$WeatherSrc = 'http://weather.noaa.gov/pub/data/observations/metar/decoded';
+$WeatherSrc = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded';
use strict;
use vars qw( $ReportDir $WeatherSrc );
@@ -40,8 +40,7 @@ my $DataFileName = "$StationID.dat";
# Is LWP installed?
eval { require LWP::UserAgent };
if ($@) {
- my $cmd = qq{wget --proxy=off --passive-ftp --tries=0 --quiet } .
- qq{--output-document=$home/$ReportDir/$HTMLFileName $URL};
+ my $cmd = qq{fetch -d -p -1 -q -o $home/$ReportDir/$HTMLFileName $URL};
`$cmd` == 0 or die "unable to fetch weather: $?";
} else {
$ENV{FTP_PASSIVE} = 1; # LWP uses Net::FTP internally.
|