Move Quotes widget to defunct

This commit is contained in:
Evgeny
2024-07-05 12:11:16 +04:00
parent 64128b5f66
commit d63f93d39d

26
defunct/quotes-widget.lua Normal file
View File

@@ -0,0 +1,26 @@
-- name = "Random quotes"
-- description = "quotable.io"
-- data_source = "quotable.io"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
-- foldable = "false"
function on_alarm()
http:get("https://api.quotable.io/random")
end
function on_network_result(result, code)
if code >= 200 and code < 299 then
quote = ajson:get_value(result, "object string:content")
author = ajson:get_value(result, "object string:author")
ui:show_lines({ quote }, { author })
end
end
function on_click()
if quote ~= nil then
system:to_clipboard(quote)
end
end