aboutsummaryrefslogtreecommitdiff
path: root/weather.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-06 03:43:38 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-06 03:43:38 +0100
commitdbd6c7b03edf6250b2f5acdf054b3392ace243e9 (patch)
tree7ea1c551c090fd75155f6a666764e5c9677c4920 /weather.lua
parent2c6b96976f63dd3b216adca46d8d83c48a7c61d4 (diff)
downloadvicious-legacy-dbd6c7b03edf6250b2f5acdf054b3392ace243e9.tar.xz
weather: capitalize weather and sky stats
Diffstat (limited to 'weather.lua')
-rw-r--r--weather.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/weather.lua b/weather.lua
index c112bb1..8e78e8b 100644
--- a/weather.lua
+++ b/weather.lua
@@ -9,6 +9,7 @@ local io = { popen = io.popen }
local setmetatable = setmetatable
local math = { ceil = math.ceil }
local string = { match = string.match }
+local helpers = require("vicious.helpers")
-- }}}
@@ -63,10 +64,16 @@ local function worker(format, station)
if weather["{windmph}"] ~= "N/A" then
weather["{windmph}"] = tonumber(weather["{windmph}"])
weather["{windkmh}"] = math.ceil(weather["{windmph}"] * 1.6)
- end -- Temperature in degree °C if °F was available
+ end -- Temperature in °C if °F was available
if weather["{tempf}"] ~= "N/A" then
weather["{tempf}"] = tonumber(weather["{tempf}"])
weather["{tempc}"] = math.ceil((weather["{tempf}"] - 32) * 5/9)
+ end -- Capitalize some stats so they don't look so out of place
+ if weather["{sky}"] ~= "N/A" then
+ weather["{sky}"] = helpers.capitalize(weather["{sky}"])
+ end
+ if weather["{weather}"] ~= "N/A" then
+ weather["{weather}"] = helpers.capitalize(weather["{weather}"])
end
return weather