<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.everycrt.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACategoryAudit</id>
	<title>Module:CategoryAudit - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.everycrt.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACategoryAudit"/>
	<link rel="alternate" type="text/html" href="https://wiki.everycrt.com/index.php?title=Module:CategoryAudit&amp;action=history"/>
	<updated>2026-08-02T06:29:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.everycrt.com/index.php?title=Module:CategoryAudit&amp;diff=6302&amp;oldid=prev</id>
		<title>Arclight-MCP-Bot: Fix category links (add colon prefix) and use Lua URL builder instead of unprocessed wikitext (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.everycrt.com/index.php?title=Module:CategoryAudit&amp;diff=6302&amp;oldid=prev"/>
		<updated>2026-02-04T22:04:16Z</updated>

		<summary type="html">&lt;p&gt;Fix category links (add colon prefix) and use Lua URL builder instead of unprocessed wikitext (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:04, 4 February 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local function &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;extractValues&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;queryResult&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-- Helper to build a &quot;create category&quot; URL&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;local valuesSet = &lt;/del&gt;{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local function &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;createCategoryUrl&lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;categoryTitle, preloadTemplate, brandOrType&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	local valuesList &lt;/del&gt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;return tostring(mw.uri.fullUrl(categoryTitle, &lt;/ins&gt;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		action &lt;/ins&gt;= &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;edit&lt;/ins&gt;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if queryResult then&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		preload &lt;/ins&gt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;preloadTemplate&lt;/ins&gt;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		for cellContent in queryResult:gmatch(&lt;/del&gt;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&lt;/del&gt;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) do&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		[&lt;/ins&gt;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;preloadparams&lt;/ins&gt;[]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;] = &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;brandOrType&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			local value &lt;/del&gt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;trim(cellContent:gsub(&#039;&amp;lt;[^&amp;gt;]+&amp;gt;&#039;&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;))&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	}&lt;/ins&gt;))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			if value and value ~= &lt;/del&gt;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039; and not valuesSet&lt;/del&gt;[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;value&lt;/del&gt;] &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;then&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				valuesSet[value&lt;/del&gt;] = &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;true&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				table.insert(valuesList, value&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	table.sort(valuesList&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	return valuesList, valuesSet&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l54&quot;&gt;Line 54:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local result = frame:preprocess(queryWikitext)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local result = frame:preprocess(queryWikitext)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local countBefore = 0&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		for _ in pairs(usedBrandsSet) do countBefore = countBefore + 1 end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if result then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if result then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l118&quot;&gt;Line 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 107:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, brand in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, brand in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:CRT models]][[Has brand::&amp;#039; .. brand .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:CRT models]][[Has brand::&amp;#039; .. brand .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;table&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;insert&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;output&lt;/del&gt;, &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &lt;/del&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039; &lt;/del&gt;.. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;brand &lt;/del&gt;.. &#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CRTs|&lt;/del&gt;&#039; .. brand .. &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] (&lt;/del&gt;&#039; .. count .. &#039; CRTs&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) — &amp;lt;span class=&quot;plainlinks&quot;&amp;gt;&lt;/del&gt;[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{fullurl:Category&lt;/del&gt;:&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;brand &lt;/del&gt;.. &#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CRTs|action=edit&amp;amp;preload=Template:CRT_brand_category/preload&amp;amp;preloadparams%5B%5D=&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mw.uri.encode(brand) &lt;/del&gt;.. &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}} &lt;/del&gt;create]&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/del&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;local categoryTitle = &#039;Category:&#039; .. brand .&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039; CRTs&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local createUrl = createCategoryUrl&lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;categoryTitle&lt;/ins&gt;, &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Template:CRT brand category/preload&#039;, brand)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		-- Use &lt;/ins&gt;[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;Category:...&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] with colon to make it a LINK not a category assignment&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		table&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;insert(output, &lt;/ins&gt;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;strong&amp;gt;&lt;/ins&gt;&#039; .. brand .. &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/strong&amp;gt; — &lt;/ins&gt;&#039; .. count .. &#039; CRTs &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;need [&lt;/ins&gt;[:&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;categoryTitle &lt;/ins&gt;.. &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] — [&lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;createUrl &lt;/ins&gt;.. &#039; create &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it&lt;/ins&gt;]&#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l207&quot;&gt;Line 207:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 199:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, crtType in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, crtType in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:CRT models]][[Has CRT type::&amp;#039; .. crtType .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:CRT models]][[Has CRT type::&amp;#039; .. crtType .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		table.insert(output, &#039;* &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:&lt;/del&gt;&#039; .. crtType .. &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;crtType &lt;/del&gt;.. &#039;]] &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;count &lt;/del&gt;.. &#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CRTs)&lt;/del&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local categoryTitle = &#039;Category:&#039; .. crtType&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local createUrl = createCategoryUrl(categoryTitle, &#039;Template:CRT type category/preload&#039;, crtType)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		table.insert(output, &#039;* &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;strong&amp;gt;&lt;/ins&gt;&#039; .. crtType .. &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/strong&amp;gt; — &lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;count .. &#039; CRTs need [[:&#039; .. categoryTitle &lt;/ins&gt;.. &#039;]] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;— [&lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;createUrl &lt;/ins&gt;.. &#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;create it]&lt;/ins&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l296&quot;&gt;Line 296:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 290:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, brand in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, brand in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:AV devices]][[Has brand::&amp;#039; .. brand .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:AV devices]][[Has brand::&amp;#039; .. brand .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		table.insert(output, &#039;* &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:&lt;/del&gt;&#039; .. brand .. &#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AV &lt;/del&gt;devices&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;brand &lt;/del&gt;.. &#039;]] &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;count &lt;/del&gt;.. &#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;devices)&lt;/del&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local categoryTitle = &#039;Category:&#039; .. brand .. &#039; AV devices&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local createUrl = createCategoryUrl(categoryTitle, &#039;Template:AV brand category/preload&#039;, brand)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		table.insert(output, &#039;* &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;strong&amp;gt;&lt;/ins&gt;&#039; .. brand .. &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/strong&amp;gt; — &#039; .. count .. &#039; &lt;/ins&gt;devices &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;need [[:&lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;categoryTitle &lt;/ins&gt;.. &#039;]] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;— [&lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;createUrl &lt;/ins&gt;.. &#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;create it]&lt;/ins&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l385&quot;&gt;Line 385:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 381:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, deviceType in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	for _, deviceType in ipairs(missing) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:AV devices]][[Has device type::&amp;#039; .. deviceType .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:AV devices]][[Has device type::&amp;#039; .. deviceType .. &amp;#039;]]|format=count}}&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		table.insert(output, &#039;* &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:&lt;/del&gt;&#039; .. deviceType .. &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s|&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;deviceType &lt;/del&gt;.. &#039;]] &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/del&gt;&#039; .. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;count &lt;/del&gt;.. &#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;devices)&lt;/del&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local categoryTitle = &#039;Category:&#039; .. deviceType .. &#039;s&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local createUrl = createCategoryUrl(categoryTitle, &#039;Template:AV device type category/preload&#039;, deviceType)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		table.insert(output, &#039;* &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;strong&amp;gt;&lt;/ins&gt;&#039; .. deviceType .. &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/strong&amp;gt; — &#039; .. count .. &#039; devices need [[:&lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;categoryTitle &lt;/ins&gt;.. &#039;]] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;— [&lt;/ins&gt;&#039; .. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;createUrl &lt;/ins&gt;.. &#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;create it]&lt;/ins&gt;&#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Arclight-MCP-Bot</name></author>
	</entry>
	<entry>
		<id>https://wiki.everycrt.com/index.php?title=Module:CategoryAudit&amp;diff=6300&amp;oldid=prev</id>
		<title>Arclight-MCP-Bot: Create module to find brands/types missing category pages (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.everycrt.com/index.php?title=Module:CategoryAudit&amp;diff=6300&amp;oldid=prev"/>
		<updated>2026-02-04T21:56:31Z</updated>

		<summary type="html">&lt;p&gt;Create module to find brands/types missing category pages (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Module:CategoryAudit&lt;br /&gt;
-- Identifies brands and types that are used on pages but don&amp;#039;t have&lt;br /&gt;
-- corresponding category pages registered for the Main Page listing.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function trim(s)&lt;br /&gt;
	if s == nil then return nil end&lt;br /&gt;
	s = tostring(s)&lt;br /&gt;
	s = s:gsub(&amp;#039;^%s+&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;%s+$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	if s == &amp;#039;&amp;#039; then return nil end&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function extractValues(queryResult)&lt;br /&gt;
	local valuesSet = {}&lt;br /&gt;
	local valuesList = {}&lt;br /&gt;
	&lt;br /&gt;
	if queryResult then&lt;br /&gt;
		for cellContent in queryResult:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
			local value = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
			if value and value ~= &amp;#039;&amp;#039; and not valuesSet[value] then&lt;br /&gt;
				valuesSet[value] = true&lt;br /&gt;
				table.insert(valuesList, value)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.sort(valuesList)&lt;br /&gt;
	return valuesList, valuesSet&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Find CRT brands that are used but don&amp;#039;t have a category page&lt;br /&gt;
function p.missingCRTBrands(frame)&lt;br /&gt;
	-- Get all brands used on CRT pages (with pagination)&lt;br /&gt;
	local usedBrandsSet = {}&lt;br /&gt;
	local batchSize = 500&lt;br /&gt;
	&lt;br /&gt;
	for batch = 0, 10 do&lt;br /&gt;
		local offset = batch * batchSize&lt;br /&gt;
		local queryWikitext =&lt;br /&gt;
			&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Category:CRT models]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Has brand::+]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |?Has brand\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |limit=&amp;#039; .. batchSize .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |offset=&amp;#039; .. offset .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
			&amp;#039;}}&amp;#039;&lt;br /&gt;
		&lt;br /&gt;
		local result = frame:preprocess(queryWikitext)&lt;br /&gt;
		local countBefore = 0&lt;br /&gt;
		for _ in pairs(usedBrandsSet) do countBefore = countBefore + 1 end&lt;br /&gt;
		&lt;br /&gt;
		if result then&lt;br /&gt;
			for cellContent in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
				local brand = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
				if brand and brand ~= &amp;#039;&amp;#039; then&lt;br /&gt;
					usedBrandsSet[brand] = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Check if we got a full batch&lt;br /&gt;
		local cellCount = 0&lt;br /&gt;
		if result then&lt;br /&gt;
			for _ in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;&amp;#039;) do&lt;br /&gt;
				cellCount = cellCount + 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if cellCount &amp;lt; batchSize then break end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get registered category pages&lt;br /&gt;
	local registeredQuery =&lt;br /&gt;
		&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; [[Is CRT brand category::Yes]]\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |?Brand name\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |limit=500\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
		&amp;#039;}}&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local registeredResult = frame:preprocess(registeredQuery)&lt;br /&gt;
	local registeredSet = {}&lt;br /&gt;
	&lt;br /&gt;
	if registeredResult then&lt;br /&gt;
		for cellContent in registeredResult:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
			local brand = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
			if brand and brand ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				registeredSet[brand] = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find missing&lt;br /&gt;
	local missing = {}&lt;br /&gt;
	for brand, _ in pairs(usedBrandsSet) do&lt;br /&gt;
		if not registeredSet[brand] then&lt;br /&gt;
			table.insert(missing, brand)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.sort(missing)&lt;br /&gt;
	&lt;br /&gt;
	if #missing == 0 then&lt;br /&gt;
		return &amp;quot;✓ &amp;#039;&amp;#039;All CRT brands have category pages.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for _, brand in ipairs(missing) do&lt;br /&gt;
		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:CRT models]][[Has brand::&amp;#039; .. brand .. &amp;#039;]]|format=count}}&amp;#039;)&lt;br /&gt;
		table.insert(output, &amp;#039;* [[Category:&amp;#039; .. brand .. &amp;#039; CRTs|&amp;#039; .. brand .. &amp;#039;]] (&amp;#039; .. count .. &amp;#039; CRTs) — &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[{{fullurl:Category:&amp;#039; .. brand .. &amp;#039; CRTs|action=edit&amp;amp;preload=Template:CRT_brand_category/preload&amp;amp;preloadparams%5B%5D=&amp;#039; .. mw.uri.encode(brand) .. &amp;#039;}} create]&amp;lt;/span&amp;gt;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(output, &amp;#039;\n&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Find CRT types that are used but don&amp;#039;t have a category page&lt;br /&gt;
function p.missingCRTTypes(frame)&lt;br /&gt;
	local usedTypesSet = {}&lt;br /&gt;
	local batchSize = 500&lt;br /&gt;
	&lt;br /&gt;
	for batch = 0, 10 do&lt;br /&gt;
		local offset = batch * batchSize&lt;br /&gt;
		local queryWikitext =&lt;br /&gt;
			&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Category:CRT models]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Has CRT type::+]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |?Has CRT type\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |limit=&amp;#039; .. batchSize .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |offset=&amp;#039; .. offset .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
			&amp;#039;}}&amp;#039;&lt;br /&gt;
		&lt;br /&gt;
		local result = frame:preprocess(queryWikitext)&lt;br /&gt;
		&lt;br /&gt;
		if result then&lt;br /&gt;
			for cellContent in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
				local crtType = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
				if crtType and crtType ~= &amp;#039;&amp;#039; then&lt;br /&gt;
					usedTypesSet[crtType] = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local cellCount = 0&lt;br /&gt;
		if result then&lt;br /&gt;
			for _ in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;&amp;#039;) do&lt;br /&gt;
				cellCount = cellCount + 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if cellCount &amp;lt; batchSize then break end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get registered&lt;br /&gt;
	local registeredQuery =&lt;br /&gt;
		&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; [[Is CRT type category::Yes]]\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |?CRT type name\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |limit=500\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
		&amp;#039;}}&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local registeredResult = frame:preprocess(registeredQuery)&lt;br /&gt;
	local registeredSet = {}&lt;br /&gt;
	&lt;br /&gt;
	if registeredResult then&lt;br /&gt;
		for cellContent in registeredResult:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
			local crtType = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
			if crtType and crtType ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				registeredSet[crtType] = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find missing&lt;br /&gt;
	local missing = {}&lt;br /&gt;
	for crtType, _ in pairs(usedTypesSet) do&lt;br /&gt;
		if not registeredSet[crtType] then&lt;br /&gt;
			table.insert(missing, crtType)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.sort(missing)&lt;br /&gt;
	&lt;br /&gt;
	if #missing == 0 then&lt;br /&gt;
		return &amp;quot;✓ &amp;#039;&amp;#039;All CRT types have category pages.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for _, crtType in ipairs(missing) do&lt;br /&gt;
		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:CRT models]][[Has CRT type::&amp;#039; .. crtType .. &amp;#039;]]|format=count}}&amp;#039;)&lt;br /&gt;
		table.insert(output, &amp;#039;* [[Category:&amp;#039; .. crtType .. &amp;#039;|&amp;#039; .. crtType .. &amp;#039;]] (&amp;#039; .. count .. &amp;#039; CRTs)&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(output, &amp;#039;\n&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Find AV brands that are used but don&amp;#039;t have a category page&lt;br /&gt;
function p.missingAVBrands(frame)&lt;br /&gt;
	local usedBrandsSet = {}&lt;br /&gt;
	local batchSize = 500&lt;br /&gt;
	&lt;br /&gt;
	for batch = 0, 10 do&lt;br /&gt;
		local offset = batch * batchSize&lt;br /&gt;
		local queryWikitext =&lt;br /&gt;
			&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Category:AV devices]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Has brand::+]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |?Has brand\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |limit=&amp;#039; .. batchSize .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |offset=&amp;#039; .. offset .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
			&amp;#039;}}&amp;#039;&lt;br /&gt;
		&lt;br /&gt;
		local result = frame:preprocess(queryWikitext)&lt;br /&gt;
		&lt;br /&gt;
		if result then&lt;br /&gt;
			for cellContent in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
				local brand = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
				if brand and brand ~= &amp;#039;&amp;#039; then&lt;br /&gt;
					usedBrandsSet[brand] = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local cellCount = 0&lt;br /&gt;
		if result then&lt;br /&gt;
			for _ in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;&amp;#039;) do&lt;br /&gt;
				cellCount = cellCount + 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if cellCount &amp;lt; batchSize then break end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get registered&lt;br /&gt;
	local registeredQuery =&lt;br /&gt;
		&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; [[Is AV brand category::Yes]]\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |?Brand name\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |limit=500\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
		&amp;#039;}}&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local registeredResult = frame:preprocess(registeredQuery)&lt;br /&gt;
	local registeredSet = {}&lt;br /&gt;
	&lt;br /&gt;
	if registeredResult then&lt;br /&gt;
		for cellContent in registeredResult:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
			local brand = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
			if brand and brand ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				registeredSet[brand] = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find missing&lt;br /&gt;
	local missing = {}&lt;br /&gt;
	for brand, _ in pairs(usedBrandsSet) do&lt;br /&gt;
		if not registeredSet[brand] then&lt;br /&gt;
			table.insert(missing, brand)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.sort(missing)&lt;br /&gt;
	&lt;br /&gt;
	if #missing == 0 then&lt;br /&gt;
		return &amp;quot;✓ &amp;#039;&amp;#039;All AV brands have category pages.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for _, brand in ipairs(missing) do&lt;br /&gt;
		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:AV devices]][[Has brand::&amp;#039; .. brand .. &amp;#039;]]|format=count}}&amp;#039;)&lt;br /&gt;
		table.insert(output, &amp;#039;* [[Category:&amp;#039; .. brand .. &amp;#039; AV devices|&amp;#039; .. brand .. &amp;#039;]] (&amp;#039; .. count .. &amp;#039; devices)&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(output, &amp;#039;\n&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Find AV device types that are used but don&amp;#039;t have a category page&lt;br /&gt;
function p.missingAVTypes(frame)&lt;br /&gt;
	local usedTypesSet = {}&lt;br /&gt;
	local batchSize = 500&lt;br /&gt;
	&lt;br /&gt;
	for batch = 0, 10 do&lt;br /&gt;
		local offset = batch * batchSize&lt;br /&gt;
		local queryWikitext =&lt;br /&gt;
			&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Category:AV devices]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; [[Has device type::+]]\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |?Has device type\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |limit=&amp;#039; .. batchSize .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |offset=&amp;#039; .. offset .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
			&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
			&amp;#039;}}&amp;#039;&lt;br /&gt;
		&lt;br /&gt;
		local result = frame:preprocess(queryWikitext)&lt;br /&gt;
		&lt;br /&gt;
		if result then&lt;br /&gt;
			for cellContent in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
				local deviceType = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
				if deviceType and deviceType ~= &amp;#039;&amp;#039; then&lt;br /&gt;
					usedTypesSet[deviceType] = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local cellCount = 0&lt;br /&gt;
		if result then&lt;br /&gt;
			for _ in result:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;&amp;#039;) do&lt;br /&gt;
				cellCount = cellCount + 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if cellCount &amp;lt; batchSize then break end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get registered&lt;br /&gt;
	local registeredQuery =&lt;br /&gt;
		&amp;#039;{{#ask:\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; [[Is AV device type category::Yes]]\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |?Device type name\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |format=broadtable\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |headers=hide\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |link=none\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |mainlabel=-\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |limit=500\n&amp;#039; ..&lt;br /&gt;
		&amp;#039; |searchlabel=\n&amp;#039; ..&lt;br /&gt;
		&amp;#039;}}&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local registeredResult = frame:preprocess(registeredQuery)&lt;br /&gt;
	local registeredSet = {}&lt;br /&gt;
	&lt;br /&gt;
	if registeredResult then&lt;br /&gt;
		for cellContent in registeredResult:gmatch(&amp;#039;&amp;lt;td[^&amp;gt;]*&amp;gt;(.-)&amp;lt;/td&amp;gt;&amp;#039;) do&lt;br /&gt;
			local deviceType = trim(cellContent:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
			if deviceType and deviceType ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				registeredSet[deviceType] = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find missing&lt;br /&gt;
	local missing = {}&lt;br /&gt;
	for deviceType, _ in pairs(usedTypesSet) do&lt;br /&gt;
		if not registeredSet[deviceType] then&lt;br /&gt;
			table.insert(missing, deviceType)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.sort(missing)&lt;br /&gt;
	&lt;br /&gt;
	if #missing == 0 then&lt;br /&gt;
		return &amp;quot;✓ &amp;#039;&amp;#039;All AV device types have category pages.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for _, deviceType in ipairs(missing) do&lt;br /&gt;
		local count = frame:preprocess(&amp;#039;{{#ask:[[Category:AV devices]][[Has device type::&amp;#039; .. deviceType .. &amp;#039;]]|format=count}}&amp;#039;)&lt;br /&gt;
		table.insert(output, &amp;#039;* [[Category:&amp;#039; .. deviceType .. &amp;#039;s|&amp;#039; .. deviceType .. &amp;#039;]] (&amp;#039; .. count .. &amp;#039; devices)&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(output, &amp;#039;\n&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Arclight-MCP-Bot</name></author>
	</entry>
</feed>