Anonymous

Module:PriceServer: Difference between revisions

From The Blockheads Wiki
Created page with "local Prices = {} local function fetchPrices() local apiUrl = "http://priceserver.theblockheads.net/get_prices.php" local response, code = mw.http.get(apiUrl) if code ~= 200 then return nil, "Error retrieving prices " .. tostring(code) end -- Parse the response local json = require('json') return json.decode(response) end function Prices.getPrice(id) local pricesData, err = fetchPrices() if err then return err end if pricesData th..."
(Created page with "local Prices = {} local function fetchPrices() local apiUrl = "http://priceserver.theblockheads.net/get_prices.php" local response, code = mw.http.get(apiUrl) if code ~= 200 then return nil, "Error retrieving prices " .. tostring(code) end -- Parse the response local json = require('json') return json.decode(response) end function Prices.getPrice(id) local pricesData, err = fetchPrices() if err then return err end if pricesData th...")
(No difference)