Initial commit

This commit is contained in:
Evgeny
2021-07-29 07:51:07 +03:00
commit 091c7dcd0b
11 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
name = "GitHub Trending"
description = "GitHub trending repositories (trending-github.com)"
scriptType = "widget"
author = "Evgeny Zobnin (zobnin@gmail.com)"
version = "1.0"
function onAlarm()
net:getText("https://api.trending-github.com/github/repositories")
end
function onNetworkResult(result)
local names = {
json:getValue(result, "array object:0 string:name"),
json:getValue(result, "array object:1 string:name"),
json:getValue(result, "array object:2 string:name"),
}
local descriptions = {
json:getValue(result, "array object:0 string:description"),
json:getValue(result, "array object:1 string:description"),
json:getValue(result, "array object:2 string:description"),
}
urls = {
json:getValue(result, "array object:0 string:url"),
json:getValue(result, "array object:1 string:url"),
json:getValue(result, "array object:2 string:url"),
}
aio:showLinesWithAuthors(names, descriptions)
end
function onClick(idx)
aio:openBrowser(urls[idx])
end