diff options
Diffstat (limited to 'widgets/weather.lua')
-rw-r--r-- | widgets/weather.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/widgets/weather.lua b/widgets/weather.lua index 7a114c0..f54fbc3 100644 --- a/widgets/weather.lua +++ b/widgets/weather.lua @@ -17,24 +17,24 @@ local helpers = require("vicious.helpers") module("vicious.widgets.weather") +-- Initialize function tables +local weather = { + ["{city}"] = "N/A", + ["{wind}"] = "N/A", + ["{windmph}"] = "N/A", + ["{windkmh}"] = "N/A", + ["{sky}"] = "N/A", + ["{weather}"] = "N/A", + ["{tempf}"] = "N/A", + ["{tempc}"] = "N/A", + ["{humid}"] = "N/A", + ["{press}"] = "N/A" +} + -- {{{ Weather widget type local function worker(format, warg) if not warg then return end - -- Default values - local weather = { - ["{city}"] = "N/A", - ["{wind}"] = "N/A", - ["{windmph}"] = "N/A", - ["{windkmh}"] = "N/A", - ["{sky}"] = "N/A", - ["{weather}"] = "N/A", - ["{tempf}"] = "N/A", - ["{tempc}"] = "N/A", - ["{humid}"] = "N/A", - ["{press}"] = "N/A" - } - -- 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/" |