Module:MinecraftServerPing

local p = {}

function p.main(frame) local text = '' local ip = '' local action = 'status' ip = frame:getParent.args[1] action = frame:getParent.args['action'] if #ip>0 then if action == 'status' then local data = mw.uri.parseQueryString('https://api.mcsrvstat.us/2/' .. ip) text = data.online end else text = 'Error: No IP given' end return text end

return p