Jump to content

Module:Professional wrestling profiles/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Edgars2007 (talk | contribs) at 08:04, 4 June 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local data = {
	{"cagematch", "http://www.cagematch.net/?id=2&nr=$1", "P2728"},
	{"wrestlingdata", "http://wrestlingdata.com/index.php?befehl=bios&wrestler=$1", "P2764"},
	{"iwd", "http://www.profightdb.com/wrestlers/$1.html", "P2829"}
}

local p = {}
local categories = {}
local ent = mw.wikibase.getEntityObject()
local yesno = require('Module:Yesno')
local getArgs = require('Module:Arguments').getArgs

function p._profiles(args)
	local title = mw.title.getCurrentTitle()
	local name = args.name or string.gsub(title.text, " %b()", "")
	local text = name .. "'s profile at "
	local out = {}
	
	for _,v in ipairs(data) do
		--local param, link, wdid = unpack(v)
		local param = args[v[1]]
		local link = v[2]
		local wdid = v[3]
				out[#out+1] = "* [" .. string.gsub(link, "$1", param) .. ' ' .. param .. "]"
	end
	
	return table.concat(out,'\n')
end	

function p.profiles(frame)
	local args = getArgs(frame)
	return p._profiles(args)
end

return p