Révision 2d95020d
NOAA decommissioned weather.noaa.gov
Change weather.noaa.gov -> tgftp.nws.noaa.gov
| plugins/weather/weather_temp_ | ||
|---|---|---|
| 1 | 1 |
#!/usr/bin/env python |
| 2 | 2 |
""" |
| 3 |
munin US NOAA weather plugin (http://weather.noaa.gov)
|
|
| 3 |
munin US NOAA weather plugin (http://tgftp.nws.noaa.gov)
|
|
| 4 | 4 |
|
| 5 | 5 |
Draws temperature/dew point in C. |
| 6 | 6 |
Copy/link file as 'weather_temp_CODE', like: weather_temp_LOWW for Austria, Vienna. |
| 7 | 7 |
|
| 8 |
Get the code by going to http://weather.noaa.gov, selecting your
|
|
| 8 |
Get the code by going to http://tgftp.nws.noaa.gov, selecting your
|
|
| 9 | 9 |
location, and copying the code from the address bar of your browser; should |
| 10 | 10 |
be something like CODE.html. |
| 11 | 11 |
|
| ... | ... | |
| 16 | 16 |
import urllib |
| 17 | 17 |
import re |
| 18 | 18 |
|
| 19 |
url = 'http://weather.noaa.gov/pub/data/observations/metar/decoded/%s.TXT'
|
|
| 19 |
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
|
|
| 20 | 20 |
|
| 21 | 21 |
re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)')
|
| 22 | 22 |
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)')
|
Formats disponibles : Unified diff