<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3APages_with_authority_control_identifiers</id>
	<title>Module:Pages with authority control identifiers - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3APages_with_authority_control_identifiers"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Pages_with_authority_control_identifiers&amp;action=history"/>
	<updated>2026-06-14T02:47:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:Pages_with_authority_control_identifiers&amp;diff=478900&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Pages_with_authority_control_identifiers&amp;diff=478900&amp;oldid=prev"/>
		<updated>2021-07-16T05:16:27Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('Module:No globals')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local ac_conf = require('Module:Authority control').conf&lt;br /&gt;
local rmCats = require('Module:Suppress categories').main&lt;br /&gt;
local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
local title = currentTitle.text&lt;br /&gt;
local isCat = (currentTitle.namespace == 14)&lt;br /&gt;
&lt;br /&gt;
--[[==========================================================================]]&lt;br /&gt;
--[[                         Local Utility Functions                          ]]&lt;br /&gt;
--[[==========================================================================]]&lt;br /&gt;
&lt;br /&gt;
local function whichTOC( frame )&lt;br /&gt;
	--local pageCount = mw.site.stats.pagesInCategory(title, 'pages')&lt;br /&gt;
	--if pageCount &amp;gt; 1200 then&lt;br /&gt;
	--	return frame:expandTemplate{ title = 'Large category TOC' }&lt;br /&gt;
	--elseif pageCount &amp;gt; 100 then&lt;br /&gt;
	--	return frame:expandTemplate{ title = 'Category TOC', args = { align = 'center' } }&lt;br /&gt;
	--end&lt;br /&gt;
	--return ''&lt;br /&gt;
	&lt;br /&gt;
	-- standardize TOC behavior via {{CatAutoTOC}}&lt;br /&gt;
	return frame:expandTemplate{ title = 'CatAutoTOC', args = { align = 'center' } }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function redCatCheck( catName ) --catName == 'Blah', not 'Category:Blah', not '[[Category:Blah]]'&lt;br /&gt;
	if catName and catName ~= '' and mw.title.new(catName, 14).exists == false then&lt;br /&gt;
		return '[[Category:Pages with authority control identifiers red-linked category]]'&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
local function getExample(conf, id)&lt;br /&gt;
	if id == &amp;quot;WORLDCATID&amp;quot; then&lt;br /&gt;
		return &amp;quot;[https://www.worldcat.org/identities/lccn-n78039510 WorldCat]&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		return rmCats(conf[3](conf[5]))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--[[==========================================================================]]&lt;br /&gt;
--[[                    Local Category-Specific Functions                     ]]&lt;br /&gt;
--[[==========================================================================]]&lt;br /&gt;
&lt;br /&gt;
--For indirect use on [[Category:&amp;lt;catType&amp;gt; with multiple identifiers]],&lt;br /&gt;
--   i.e. on [[Category:Wikipedia articles with multiple identifiers]]&lt;br /&gt;
local function multiple( frame, catType, pre, post )&lt;br /&gt;
	local txCatMore  = frame:expandTemplate{ title = 'Cat more', args = { 'Wikipedia:Authority control' } }&lt;br /&gt;
	local txEmptyCat = frame:expandTemplate{ title = 'Possibly empty category' }&lt;br /&gt;
	local txWPCat    = frame:expandTemplate{ title = 'Wikipedia category', args = { hidden = 'yes', tracking = 'yes' } }&lt;br /&gt;
	local txQ        = frame:expandTemplate{ title = 'Q', args = { 'Q7245' } }&lt;br /&gt;
	local txWdpl1    = frame:expandTemplate{ title = 'Wikidata property link', args = { 'P213' } }&lt;br /&gt;
	local txWdpl2    = frame:expandTemplate{ title = 'Wikidata property link', args = { 'P244' } }&lt;br /&gt;
	local txTOC      = whichTOC( frame )&lt;br /&gt;
	local ex = 'For example, '..txQ..' contains multiple IDs for '..txWdpl1..', '..txWdpl2..', etc.&amp;lt;br/&amp;gt;'&lt;br /&gt;
	local only = 'Pages in this category should only be added by [[Module:Authority control]].'&lt;br /&gt;
	if catType and catType == 'pages' then&lt;br /&gt;
		txEmptyCat = ''&lt;br /&gt;
		txWPCat = frame:expandTemplate{ title = 'Wikipedia category' }&lt;br /&gt;
		ex = ''&lt;br /&gt;
		only = ''&lt;br /&gt;
	end&lt;br /&gt;
	local outString = txCatMore..txEmptyCat..txWPCat..txTOC..'\n'..ex..only&lt;br /&gt;
	return (pre or '')..outString..(post or '')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:Pages with authority control information]],&lt;br /&gt;
--   i.e. on [[Category:Pages with VIAF identifiers]]&lt;br /&gt;
local function pages( frame, id )&lt;br /&gt;
	if id == 'multiple' then&lt;br /&gt;
		local pagesCat = 'Pages with authority control information'&lt;br /&gt;
		local pagesCatFull = '[[Category:'..pagesCat..']]'..redCatCheck(pagesCat)&lt;br /&gt;
		return multiple( frame, 'pages', '', pagesCatFull )&lt;br /&gt;
	end&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.link or conf[1] .. ' (identifier)'&lt;br /&gt;
			local wdpl = ':d:Property:P'..conf[2]&lt;br /&gt;
			local txCatMore = frame:expandTemplate{ title = 'Cat more', args = {'Wikipedia:Authority control', linktarget, wdpl} }&lt;br /&gt;
			local txWPCat   = frame:expandTemplate{ title = 'Wikipedia category' }&lt;br /&gt;
			local pagesCat  = 'Pages with authority control information'&lt;br /&gt;
			local outString = txCatMore..txWPCat..'\n'..&lt;br /&gt;
							'[[Category:'..pagesCat..'|'..id..']]'..redCatCheck(pagesCat)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:Miscellaneous pages with authority control information]],&lt;br /&gt;
--   i.e. on [[Category:Miscellaneous pages with VIAF identifiers]]&lt;br /&gt;
local function misc( frame, id )&lt;br /&gt;
	if id == 'multiple' then&lt;br /&gt;
		local link = id&lt;br /&gt;
		local txCatExplain = frame:expandTemplate{ title = 'Category explanation', &lt;br /&gt;
				args = { 'pages, other than main user pages or Wikipedia articles, using {{[[Template:Authority control|Authority control]]}} with '..link..' identifiers.' } }&lt;br /&gt;
		local idCat   = 'Pages with '..id..' identifiers'&lt;br /&gt;
		local miscCat = 'Miscellaneous pages with authority control information'&lt;br /&gt;
		local idCatFull   = '[[Category:'..idCat..']]'..redCatCheck(idCat)&lt;br /&gt;
		local miscCatFull = '[[Category:'..miscCat..'|'..id..']]'..redCatCheck(miscCat)&lt;br /&gt;
		return multiple( frame, 'misc', txCatExplain, idCatFull..miscCatFull )&lt;br /&gt;
	end&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.link or conf[1] .. ' (identifier)'&lt;br /&gt;
			local link = '[['..linktarget..'|'..conf[1]..']]'&lt;br /&gt;
			local example = 'The ' .. conf[1].. ' identifier appears as '..getExample(conf,id)..' in the '..conf[4]..' section.'&lt;br /&gt;
			local wdpl = ':d:Property:P'..conf[2]&lt;br /&gt;
			local txCatExplain = frame:expandTemplate{ title = 'Category explanation', &lt;br /&gt;
					args = { 'pages, other than main user pages or Wikipedia articles, using {{[[Template:Authority control|Authority control]]}} with '..link..' identifiers. '..example } }&lt;br /&gt;
			local txCatMore  = frame:expandTemplate{ title = 'Cat more', args = {'Wikipedia:Authority control', wdpl} }&lt;br /&gt;
			local txEmptyCat = frame:expandTemplate{ title = 'Possibly empty category' }&lt;br /&gt;
			local txWPCat    = frame:expandTemplate{ title = 'Wikipedia category', args = { hidden = 'yes', tracking = 'yes' } }&lt;br /&gt;
			local txTOC = whichTOC( frame )&lt;br /&gt;
			local idCat = 'Pages with '..id..' identifiers'&lt;br /&gt;
			local miscCat = 'Miscellaneous pages with authority control information'&lt;br /&gt;
			local outString = txCatExplain..txCatMore..txEmptyCat..txWPCat..txTOC..'\n'..&lt;br /&gt;
							'Pages in this category should only be added by [[Module:Authority control]].'..&lt;br /&gt;
							'[[Category:'..idCat..']]'..redCatCheck(idCat)..&lt;br /&gt;
							'[[Category:'..miscCat..'|'..id..']]'..redCatCheck(miscCat)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:User pages with authority control information]],&lt;br /&gt;
--   i.e. on [[Category:User pages with VIAF identifiers]]&lt;br /&gt;
local function user( frame, id )&lt;br /&gt;
	if id == 'multiple' then&lt;br /&gt;
		local idCat   = 'Pages with '..id..' identifiers'&lt;br /&gt;
		local userCat = 'User pages with authority control information'&lt;br /&gt;
		local idCatFull   = '[[Category:'..idCat..']]'..redCatCheck(idCat)&lt;br /&gt;
		local userCatFull = '[[Category:'..userCat..'|'..id..']]'..redCatCheck(userCat)&lt;br /&gt;
		return multiple( frame, 'user', '', idCatFull..userCatFull )&lt;br /&gt;
	end&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.link or conf[1] .. ' (identifier)'			local wdpl = ':d:Property:P'..conf[2]&lt;br /&gt;
			local txCatMore  = frame:expandTemplate{ title = 'Cat more', args = {'Wikipedia:Authority control', linktarget, wdpl} }&lt;br /&gt;
			local txEmptyCat = frame:expandTemplate{ title = 'Possibly empty category' }&lt;br /&gt;
			local txWPCat    = frame:expandTemplate{ title = 'Wikipedia category', args = { hidden = 'yes', tracking = 'yes' } }&lt;br /&gt;
			local txTOC      = whichTOC( frame )&lt;br /&gt;
			local idCat   = 'Pages with '..id..' identifiers'&lt;br /&gt;
			local userCat = 'User pages with authority control information'&lt;br /&gt;
			local outString = txCatMore..txEmptyCat..txWPCat..txTOC..'\n'..&lt;br /&gt;
							'Pages in this category should only be added by [[Module:Authority control]].'..&lt;br /&gt;
							'[[Category:'..idCat..']]'..redCatCheck(idCat)..&lt;br /&gt;
							'[[Category:'..userCat..'|'..id..']]'..redCatCheck(userCat)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:Wikipedia articles with authority control information]],&lt;br /&gt;
--   i.e. on [[Category:Wikipedia articles with VIAF identifiers]]&lt;br /&gt;
local function wp( frame, id )&lt;br /&gt;
	if id == 'multiple' then&lt;br /&gt;
		local link = id&lt;br /&gt;
		local txCatExplain = frame:expandTemplate{ title = 'Category explanation', args = {'articles with '..link..' identifiers. Please do not add [[Wikipedia:Categorization#Subcategorization|subcategories]].'} }&lt;br /&gt;
		local idCat = 'Pages with '..id..' identifiers'&lt;br /&gt;
		local wpCat = 'Wikipedia articles with authority control information'&lt;br /&gt;
		local idCatFull = '[[Category:'..idCat..']]'..redCatCheck(idCat)&lt;br /&gt;
		local wpCatFull = '[[Category:'..wpCat..'|'..id..']]'..redCatCheck(wpCat)&lt;br /&gt;
		return multiple( frame, 'wp', txCatExplain, idCatFull..wpCatFull )&lt;br /&gt;
	end&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.link or conf[1] .. ' (identifier)'			local link = '[['..linktarget..'|'..conf[1]..']]'&lt;br /&gt;
			local wdpl = ':d:Property:P'..conf[2]&lt;br /&gt;
			local example = 'The ' .. conf[1].. ' identifier appears as '..getExample(conf, id)..' in the '..conf[4]..' section.'&lt;br /&gt;
			local txCatExplain = frame:expandTemplate{ title = 'Category explanation', args = {'articles with '..link..' identifiers.'..example..' Please do not add [[Wikipedia:Categorization#Subcategorization|subcategories]].'} }&lt;br /&gt;
			local txCatMore    = frame:expandTemplate{ title = 'Cat more', args = {'Wikipedia:Authority control', wdpl} }&lt;br /&gt;
			local txEmptyCat   = frame:expandTemplate{ title = 'Possibly empty category' }&lt;br /&gt;
			local txWPCat      = frame:expandTemplate{ title = 'Wikipedia category', args = { hidden = 'yes', tracking = 'yes' } }&lt;br /&gt;
			local txTOC = whichTOC( frame )&lt;br /&gt;
			local idCat = 'Pages with '..id..' identifiers'&lt;br /&gt;
			local wpCat = 'Wikipedia articles with authority control information'&lt;br /&gt;
			local outString = txCatExplain..txCatMore..txEmptyCat..txWPCat..txTOC..'\n'..&lt;br /&gt;
							'Pages in this category should only be added by [[Module:Authority control]].'..&lt;br /&gt;
							'[[Category:'..idCat..']]'..redCatCheck(idCat)..&lt;br /&gt;
							'[[Category:'..wpCat..'|'..id..']]'..redCatCheck(wpCat)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:Wikipedia articles with faulty authority control information]],&lt;br /&gt;
--   i.e. on [[Category:Wikipedia articles with faulty VIAF identifiers]]&lt;br /&gt;
local function wpfaulty( frame, id )&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.link or conf[1] .. ' (identifier)'&lt;br /&gt;
			local wdpl = ':d:Property:P'..conf[2]&lt;br /&gt;
			local txCatMore  = frame:expandTemplate{ title = 'Cat more', args = {'Wikipedia:Authority control', linktarget, wdpl} }&lt;br /&gt;
			local txEmptyCat = frame:expandTemplate{ title = 'Possibly empty category' }&lt;br /&gt;
			local txWPCat    = frame:expandTemplate{ title = 'Wikipedia category', args = { hidden = 'yes', tracking = 'yes' } }&lt;br /&gt;
			local txDirtyCat = frame:expandTemplate{ title = 'Polluted category' }&lt;br /&gt;
			local txTOC = whichTOC( frame )&lt;br /&gt;
			local idCat = 'Pages with '..id..' identifiers'&lt;br /&gt;
			local wpfCat = 'Wikipedia articles with faulty authority control information'&lt;br /&gt;
			local outString = txCatMore..txEmptyCat..txWPCat..txDirtyCat..txTOC..'\n'..&lt;br /&gt;
							'Pages in this category should only be added by [[Module:Authority control]].'..&lt;br /&gt;
							'[[Category:'..idCat..']]'..redCatCheck(idCat)..&lt;br /&gt;
							'[[Category:'..wpfCat..'|'..id..']]'..redCatCheck(wpfCat)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[==========================================================================]]&lt;br /&gt;
--[[                            Main/External Call                            ]]&lt;br /&gt;
--[[==========================================================================]]&lt;br /&gt;
function p.autoDetect( frame )&lt;br /&gt;
	if isCat then&lt;br /&gt;
		local pagesID    = mw.ustring.match(title, 'Pages with ([%w%.%- ]+) identifiers')&lt;br /&gt;
		local miscID     = mw.ustring.match(title, 'Miscellaneous pages with ([%w%.%- ]+) identifiers')&lt;br /&gt;
		local userID     = mw.ustring.match(title, 'User pages with ([%w%.%- ]+) identifiers')&lt;br /&gt;
		local wpfaultyID = mw.ustring.match(title, 'Wikipedia articles with faulty ([%w%.%- ]+) identifiers')&lt;br /&gt;
		local wpID       = mw.ustring.match(title, 'Wikipedia articles with ([%w%.%- ]+) identifiers')&lt;br /&gt;
		&lt;br /&gt;
		if     pagesID    then return pages( frame, pagesID )&lt;br /&gt;
		elseif miscID     then return misc( frame, miscID )&lt;br /&gt;
		elseif userID     then return user( frame, userID )&lt;br /&gt;
		elseif wpfaultyID then return wpfaulty( frame, wpfaultyID ) --must be before wpID check, in case they both match&lt;br /&gt;
		elseif wpID       then return wp( frame, wpID )             --to keep the regex simple&lt;br /&gt;
		else   return '[[Category:Pages with authority control identifiers unknown category]]'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>