Module:WikiList

local p = {}

function p._format( refList ) local root = mw.html.create( "div" ):addClass("t_wikilist") root :tag("div"):addClass("t_wikilist_head") :wikitext("Independent wikis with more information:") list_div = root:tag( "div" ):addClass("t_wikilist_body") for name, url in pairs(refList) do		list_div:tag("span") :wikitext("[" .. url .. " " .. name .. "] ") end return tostring(root) end

function p.wikiList( frame ) local type = frame:getParent.args[1] local target = frame:getParent.args[2] or mw.title.getCurrentTitle.text local data = mw.ext.externalData.getExternalData { url = 'https://gamewikis.github.io/WikiLookup/WikiLookup.json', data = "json=__json" }	local refList = {} for wiki, wikiData in pairs(data["json"]) do		mw.logObject(wikiData[type]) if wikiData[type] ~= nil then for _, game in pairs(wikiData[type]) do				if game == target then refList[wiki] = wikiData["homepage"] end end end end

if next(refList) == nil then return "" else return p._format( refList ) end end

return p