<?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%3AFeaturedTopicSum</id>
	<title>Module:FeaturedTopicSum - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AFeaturedTopicSum"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:FeaturedTopicSum&amp;action=history"/>
	<updated>2026-06-13T21:26:39Z</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:FeaturedTopicSum&amp;diff=471640&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:FeaturedTopicSum&amp;diff=471640&amp;oldid=prev"/>
		<updated>2021-07-15T21:35:39Z</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;-- This module implements {{FeaturedTopicSum}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function pagesInCategory(category)&lt;br /&gt;
	-- Gets the number of pages in a category. Counting pages in a category is&lt;br /&gt;
	-- expensive, so use pcall in case we are being used on pages with lots of&lt;br /&gt;
	-- expensive function calls.&lt;br /&gt;
	local success, noPages = pcall(&lt;br /&gt;
		mw.site.stats.pagesInCategory,&lt;br /&gt;
		category,&lt;br /&gt;
		'pages'&lt;br /&gt;
	)&lt;br /&gt;
	return success and noPages or 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.status(topic)&lt;br /&gt;
	if not topic then&lt;br /&gt;
		error('no topic specified', 2)&lt;br /&gt;
	end&lt;br /&gt;
	local baseCategory = 'Wikipedia featured topics ' .. topic&lt;br /&gt;
	local noGood = pagesInCategory(baseCategory .. ' good content')&lt;br /&gt;
	local noFeatured = pagesInCategory(baseCategory .. ' featured content')&lt;br /&gt;
	local noOther = pagesInCategory(baseCategory)&lt;br /&gt;
&lt;br /&gt;
	-- For a topic to be featured:&lt;br /&gt;
	-- 1) it must contain at least two featured articles, and&lt;br /&gt;
	-- 2) 50% or more of its articles must be featured.&lt;br /&gt;
	-- If either of these criteria are not met, the topic is assumed to be a&lt;br /&gt;
	-- good topic.&lt;br /&gt;
	if noFeatured &amp;gt;= 2 and noFeatured &amp;gt;= (noGood + noOther) then&lt;br /&gt;
		return 'FT'&lt;br /&gt;
	else&lt;br /&gt;
		return 'GT'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	local status = p.status(args[1])&lt;br /&gt;
	if status == 'FT' then&lt;br /&gt;
		return args[2]&lt;br /&gt;
	else&lt;br /&gt;
		return args[3]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require('Module:Arguments').getArgs(frame, {&lt;br /&gt;
		wrappers = 'Template:FeaturedTopicSum'&lt;br /&gt;
	})&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>