Module:PriceServer: Difference between revisions
From The Blockheads Wiki
no edit summary
FloofyPlasma (talk | contribs) No edit summary |
FloofyPlasma (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
local | local PriceServer = {} | ||
local function fetchPrices() | local function fetchPrices() | ||
Line 14: | Line 14: | ||
end | end | ||
function | function PriceServer.getPrice(id) | ||
local pricesData, err = fetchPrices() | local pricesData, err = fetchPrices() | ||
Line 32: | Line 32: | ||
end | end | ||
return | function PriceServer.getPriceGraphImage(id) | ||
return string.format('<img src="http://priceserver.theblockheads.net/get_price_graph_data.php?item_id=%s" alt="Price graph for item %s" />', id, id) | |||
end | |||
return PriceServer |