Files
aiolauncher_scripts/quotes-widget.lua
2021-07-31 14:21:59 +03:00

17 lines
425 B
Lua

-- name = "Random quotes"
-- description = "quotable.io"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://api.quotable.io/random")
end
function onNetworkResult(result)
local quote = json:getValue(result, "object string:content")
local author = json:getValue(result, "object string:author")
ui:showLines({ quote }, { author })
end