这是一个示例代码,用于解码json数据,如果您提供的链接可以解码,我恰好可以制作一个json文本文件并对其进行解码,希望对您有所帮助
local json = require "json"
local txt
local path = system.pathForFile( "json.txt", system.ResourceDirectory )
local file = io.open( path, "r" )
for line in file:lines() do
txt = line
end
print(txt)
local t = json.decode( txt )
print(t["pool_name"])
print(t["hashrate"])
print(t["workers"])
print(t["share_this_round"])
print(t["last_block"])
print(t["network_hashrate"])