Module:Exists

From WikiProjectMed
Jump to navigation Jump to search

Documentation for this module may be created at Module:Exists/doc

--[[
Module to test whether a page exists on Commons
--]]

local p = {}

p.main = function(frame)
	local pagename = frame.args.name or ""
	if pagename == "" then return end
	titleobject = mw.title.makeTitle( "File", "En.Wikipedia-VideoWiki-Gout.webm", "", "Commons" )
	if not titleobject then return "invalid" end
	return titleobject.exists
end

return p