move btc widget out of main widgets

This commit is contained in:
Evgeny
2021-08-22 09:52:15 +03:00
parent d90d4b3f2e
commit 89a6ef4419

16
community/btc-widget.lua Normal file
View File

@@ -0,0 +1,16 @@
-- name = "Bitcoin price"
-- description = "Current Bitcoin price (blockchain.info)"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
equals = "<font color=\""..ui:get_secondary_text_color().."\"> = </font>"
function on_alarm()
http:get("https://api.blockchain.info/ticker")
end
function on_network_result(result)
local price = ajson:get_value(result, "object object:USD string:last")
ui:show_text("1 BTC"..equals..price.." USD")
end