Files
aiolauncher_scripts/btc-widget.lua
2021-07-30 10:42:12 +03:00

15 lines
401 B
Lua

-- 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
function onNetworkResult(result)
local price = json:getValue(result, "object object:USD string:last")
ui:showText("BTC = "..price.." USD")
end