Files
aiolauncher_scripts/community/dad-jokes-widget.lua
2025-05-03 12:56:03 +08:00

21 lines
422 B
Lua

-- name = "Dad jokes"
-- description = "icanhazdadjoke.com"
-- type = "widget"
-- author = "me"
-- version = "1.0"
function on_resume()
http:get("http://icanhasdadjoke.com/slack")
end
function on_network_result(result)
joke = ajson:read(result, "object array:attachments object:0 string:text")
ui:show_text(joke)
end
function on_click()
if joke ~= nil then
system:to_clipboard(joke)
end
end