Use a more familiar lua snake_hour

This commit is contained in:
Evgeny
2021-08-01 19:57:41 +03:00
parent 6e24536f99
commit f24288af99
26 changed files with 208 additions and 184 deletions

View File

@@ -4,19 +4,19 @@
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
equals = "<font color=\""..ui:getSecondaryTextColor().."\"> = </font>"
equals = "<font color=\""..ui:get_secondary_text_color().."\"> = </font>"
function onAlarm()
net:getText("https://api.covid19api.com/summary")
function on_alarm()
net:get_text("https://api.covid19api.com/summary")
end
function onNetworkResult(result)
local new = json:getValue(result, "object object:Global int:NewConfirmed")
local total = json:getValue(result, "object object:Global int:TotalConfirmed")
local newDeaths = json:getValue(result, "object object:Global int:NewDeaths")
local totalDeaths = json:getValue(result, "object object:Global int:TotalDeaths")
function on_network_result(result)
local new = ajson:get_value(result, "object object:Global int:NewConfirmed")
local total = ajson:get_value(result, "object object:Global int:TotalConfirmed")
local newDeaths = ajson:get_value(result, "object object:Global int:NewDeaths")
local totalDeaths = ajson:get_value(result, "object object:Global int:TotalDeaths")
ui:showLines({
ui:show_lines({
"<b>Disease</b> | total"..equals..comma_value(total).." | new"..equals..comma_value(new),
"<b>Deaths</b> | total"..equals..comma_value(totalDeaths).." | new"..equals..comma_value(newDeaths)
})