add some quotes scripts

This commit is contained in:
Evgeny
2021-07-29 21:02:05 +03:00
parent 705d651677
commit 22e209211a
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
function onAlarm()
net:getText("https://inspiration.goprogram.ai/")
end
function onNetworkResult(result)
local quote = json:getValue(result, "object string:quote")
local author = json:getValue(result, "object string:author")
ui:showLinesWithAuthors({ quote }, { author })
end

10
quotes-widget.lua Normal file
View File

@@ -0,0 +1,10 @@
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:showLinesWithAuthors({ quote }, { author })
end