diff --git a/quotes-ru-widget.lua b/quotes-ru-widget.lua new file mode 100644 index 0000000..67ca82a --- /dev/null +++ b/quotes-ru-widget.lua @@ -0,0 +1,10 @@ +function onAlarm() + net:getText("http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=ru") +end + +function onNetworkResult(result) + local quote = json:getValue(result, "object string:quoteText") + local author = json:getValue(result, "object string:quoteAuthor") + + ui:showLinesWithAuthors({ quote }, { author }) +end