aboutsummaryrefslogtreecommitdiff
path: root/widgets/weather.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 03:37:40 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 03:37:40 +0100
commit4dad2e360c1c464feef9a8aaff6e96a7636c54b7 (patch)
tree03290f705cef2ec761a0a1ee46b3bc38cb08e0ea /widgets/weather.lua
parent237470c8f45190b213e3a173ce6ae1a74b3e11fe (diff)
downloadvicious-legacy-4dad2e360c1c464feef9a8aaff6e96a7636c54b7.tar.xz
API: missing warg should not break awesome
Diffstat (limited to 'widgets/weather.lua')
-rw-r--r--widgets/weather.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/widgets/weather.lua b/widgets/weather.lua
index effa138..7a114c0 100644
--- a/widgets/weather.lua
+++ b/widgets/weather.lua
@@ -18,7 +18,9 @@ module("vicious.widgets.weather")
-- {{{ Weather widget type
-local function worker(format, station)
+local function worker(format, warg)
+ if not warg then return end
+
-- Default values
local weather = {
["{city}"] = "N/A",
@@ -36,7 +38,7 @@ local function worker(format, station)
-- Get weather forceast by the station ICAO code, from:
-- * US National Oceanic and Atmospheric Administration
local noaa = "http://weather.noaa.gov/pub/data/observations/metar/decoded/"
- local f = io.popen("curl --connect-timeout 1 -fsm 3 "..noaa..station..".TXT")
+ local f = io.popen("curl --connect-timeout 1 -fsm 3 "..noaa..warg..".TXT")
local ws = f:read("*all")
f:close()