add metadata
This commit is contained in:
12
README_ru.md
12
README_ru.md
@@ -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"
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
20
isdayoff-ru-widget.lua
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user