add metadata

This commit is contained in:
Evgeny
2021-07-30 10:42:12 +03:00
parent 703dff5ffb
commit 572ffcf930
11 changed files with 86 additions and 0 deletions

View File

@@ -84,3 +84,15 @@ end
* `double:имя`
Также вместо `object` можно использовать `array` если в JSON находится массив.
# Метаданные
Чтобы AIO Launcher смог корректно показать информацию о скрипте в каталоге скриптов и корректно вывести заголовок, вы должны добавить в начало скрипта метаданные. Например:
```
-- name = "Covid info"
-- description = "Cases of illness and death from covid (covid19api.com)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
```

View File

@@ -1,3 +1,9 @@
-- name = "Bitcoin price"
-- description = "Current Bitcoin price (blockchain.info)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://api.blockchain.info/ticker")
end

View File

@@ -1,3 +1,9 @@
-- name = "Covid info"
-- description = "Cases of illness and death from covid (covid19api.com)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://api.covid19api.com/summary")
end

View File

@@ -1,3 +1,9 @@
-- name = "Chuck Norris jokes"
-- description = "icndb.com"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("http://api.icndb.com/jokes/random")
end

View File

@@ -1,3 +1,9 @@
-- name = "Inspiration quotes"
-- description = "inspiration.goprogram.ai"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://inspiration.goprogram.ai/")
end

20
isdayoff-ru-widget.lua Normal file
View File

@@ -0,0 +1,20 @@
-- name = "Сегодня выходной?"
-- description = "Показывает, выходной ли сегодня день (isdayoff.ru)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
local dateStr = os.date('%Y%m%d')
net:getText("https://isdayoff.ru/"..dateStr)
end
function onNetworkResult(result)
if result == "0" then
ui:showText("Сегодня рабочий день")
elseif result == "1" then
ui:showText("Сегодня выходной")
else
ui:showText("Ошибка")
end
end

View File

@@ -1,3 +1,9 @@
-- name = "Public IP"
-- description = "Shows your public IP (ipify.org)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://api.ipify.org")
end

View File

@@ -1,3 +1,9 @@
-- name = "Цитаты великих"
-- description = "Рандомные цитаты на русском (forismatic.com)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=ru")
end

View File

@@ -1,3 +1,9 @@
-- name = "Random quotes"
-- description = "quotable.io"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://api.quotable.io/random")
end

View File

@@ -1,3 +1,9 @@
-- name = "Random jokes"
-- description = "official-joke-api.appspot.com"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onAlarm()
net:getText("https://official-joke-api.appspot.com/random_joke")
end

View File

@@ -1,3 +1,9 @@
-- name = "Year progess"
-- description = "Shows current year progress"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
function onResume()
local yearDays = 365
local currentDay = os.date("*t").yday