Révision 2d95020d
NOAA decommissioned weather.noaa.gov
Change weather.noaa.gov -> tgftp.nws.noaa.gov
| plugins/weather/temperature_ | ||
|---|---|---|
| 2 | 2 |
# |
| 3 | 3 |
# Copyright (C) 2006 Lars Strand |
| 4 | 4 |
# |
| 5 |
# Plugin to fetch temperature from weather.noaa.gov
|
|
| 5 |
# Plugin to fetch temperature from tgftp.nws.noaa.gov
|
|
| 6 | 6 |
# |
| 7 | 7 |
# Parameters supported: |
| 8 | 8 |
# |
| ... | ... | |
| 16 | 16 |
use strict; |
| 17 | 17 |
|
| 18 | 18 |
my $usehum = $ENV{humidity} || undef; # set to "yes" to enable humidity
|
| 19 |
my $wcode = $ENV{wcode} || "ENGM"; # Find areacode here http://weather.noaa.gov/
|
|
| 19 |
my $wcode = $ENV{wcode} || "ENGM"; # Find areacode here http://tgftp.nws.noaa.gov/
|
|
| 20 | 20 |
my $unit = $ENV{unit} || "C"; # "C" = Celsius, "F" = Fahrenheit
|
| 21 | 21 |
my $proxy = $ENV{proxy} || undef; # Example: "http://proxy.foo.bar:8080/"
|
| 22 | 22 |
|
| ... | ... | |
| 41 | 41 |
} |
| 42 | 42 |
|
| 43 | 43 |
|
| 44 |
my $datasource = "http://weather.noaa.gov/pub/data/observations/metar/decoded/$wcode.TXT";
|
|
| 44 |
my $datasource = "http://tgftp.nws.noaa.gov/data/observations/metar/decoded/$wcode.TXT";
|
|
| 45 | 45 |
|
| 46 | 46 |
my $ua = LWP::UserAgent->new(timeout => 30); |
| 47 | 47 |
$ua->agent('Munin');
|
Formats disponibles : Unified diff