View source for Module:FindYDCportal
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
--[[
For a given 3- or 4-digit year or decade, find the most specific portal
which actually exists.
Takes one parameter, which must be either a year (e.g. "1879", "1123")
or a decade (e.g. "1940s", "790s").
If a portal is found, return its name with out the nmaespace prefix
(e.g. for "Portal:1980s" rerurn "1980s"); otherwise return an empty string.
If the parameter is missing, empty, or does not fit the required format,
an empty string is returned"
]]
local p = {}
-- check for the existence of a portal with the given name
-- if it exists, returns the name
-- otherwise returns nil
function doesPortalExist(portalName)
local portalPage = mw.title.new( portalName, "Portal" )
if (portalPage.exists) then
return portalName
end
000
1:0
Template used on this page:
Return to Module:FindYDCportal.