Jump to content

Module:Sandbox/Edgars2007

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Edgars2007 (talk | contribs) at 09:59, 14 September 2015. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}
 
function p.main(frame)
	local out = {}
	for k,v in ipairs(frame.args) do
		local id = tonumber(v)
		if not id then
			error(string.format("Invalid ID %s", v))
		end
		local title = mw.title.new(id)
		if title then
			out[k] = string.format("* %d: %s\n", title.id, title.prefixedText)
		else
			out[k] = string.format("* No page exists with ID %d\n", id)
		end
	end
	return table.concat(out)
end
 
return p