Jump to content

Module:Sandbox/Edgars2007

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jackmcbarn (talk | contribs) at 15:41, 7 July 2015 (apply fixes per talk). 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("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