diff options
author | Martin Striz <striz@raynet.cz> | 2009-12-27 18:39:12 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-12-27 20:21:12 +0100 |
commit | fba4db6d3764f95b7dbf9bb3794c4fe1587206c4 (patch) | |
tree | 2a3af0284c56ea30d09257fb947b56008c290eb1 | |
parent | 2100ea1d8c5cca19b83ffc1d12522a83149af763 (diff) | |
download | vicious-legacy-fba4db6d3764f95b7dbf9bb3794c4fe1587206c4.tar.xz |
weather: fix parsing of negative temperatures
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
-rw-r--r-- | weather.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weather.lua b/weather.lua index 57362c8..383be97 100644 --- a/weather.lua +++ b/weather.lua @@ -54,9 +54,9 @@ local function worker(format, station) weather["{weather}"] = -- Weather conditions if available string.match(ws, "Weather:[%s](.-)[%c]") or weather["{weather}"] weather["{tempf}"] = -- Temperature in fahrenheit - string.match(ws, "Temperature:[%s]([%d%.]+).*[%c]") or weather["{tempf}"] + string.match(ws, "Temperature:[%s]([%-]?[%d%.]+).*[%c]") or weather["{tempf}"] weather["{tempc}"] = -- Temperature in celsius - string.match(ws, "Temperature:[%s][%d%.]+[%s]F[%s]%(([%d%.]+)[%s]C%)[%c]") or weather["{tempc}"] + string.match(ws, "Temperature:[%s][%d%.]+[%s]F[%s]%(([%-]?[%d%.]+)[%s]C%)[%c]") or weather["{tempc}"] weather["{humid}"] = -- Relative humidity in percent string.match(ws, "Relative[%s]Humidity:[%s]([%d]+)%%") or weather["{humid}"] weather["{press}"] = -- Pressure in hPa |