此模块的文档可以在模块:SteamPrice/doc创建
local p = {}
local http = require("socket.http")
local ltn12 = require("ltn12")
local json = require("dkjson")
local url = "https://store.steampowered.com/api/appdetails?appids=245170&cc=cn&filters=price_overview"
local response = {}
local data = json.decode(table.concat(response))
local priceOverview = data["245170"].data.price_overview
function p.discount()
return string.format('%s', priceOverview.discount_percent)
end
function p.price()
return string.format('%s', priceOverview.final)
end
return p