<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2Fpietrasagh%2FTohaomg</id>
	<title>Module:Sandbox/pietrasagh/Tohaomg - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2Fpietrasagh%2FTohaomg"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/pietrasagh/Tohaomg&amp;action=history"/>
	<updated>2026-05-28T11:56:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/pietrasagh/Tohaomg&amp;diff=146566&amp;oldid=prev</id>
		<title>imported&gt;Pietrasagh: ←Created page with &#039;local p = {} --create object (table) to be returned  function p.main(frame) 	args = frame:getParent().args; --get all the parameters given in template call: {{Te...&#039;</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/pietrasagh/Tohaomg&amp;diff=146566&amp;oldid=prev"/>
		<updated>2020-10-03T08:36:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=WP:AES&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:AES (page does not exist)&quot;&gt;←&lt;/a&gt;Created page with &amp;#039;local p = {} --create object (table) to be returned  function p.main(frame) 	args = frame:getParent().args; --get all the parameters given in template call: {{Te...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {} --create object (table) to be returned&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	args = frame:getParent().args; --get all the parameters given in template call: {{Template|arg[1]|arg[2]|etc}}&lt;br /&gt;
	&lt;br /&gt;
	res = {&amp;#039;{| class=&amp;quot;wikitable&amp;quot;\n! Article\n! Good articles\n! Featured articles\n&amp;#039;} --table storing text, which this module returns&lt;br /&gt;
	&lt;br /&gt;
	for k1, page_title in ipairs(args) do --iterate over each given argument&lt;br /&gt;
		item = mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(page_title), &amp;#039;enwiki&amp;#039;); --get information from Wikidata item connected to the page&lt;br /&gt;
		good, featured = {}, {} --create empty tables for good and featured articles&lt;br /&gt;
		if item then --continue if item exists&lt;br /&gt;
			for k2, site_info in pairs(item.sitelinks) do --iterate over each given site&lt;br /&gt;
				x = mw.text.split(site_info.site, &amp;#039;wiki&amp;#039;) --split site name into two parts: before &amp;#039;wiki&amp;#039; and after &amp;#039;wiki&amp;#039;&lt;br /&gt;
				language_code, tail = x[1], x[2] --&amp;#039;x&amp;#039; now is a table of two values, first is two-letter language code, the second is a tail after &amp;#039;wiki&amp;#039;&lt;br /&gt;
				language_code = language_code:gsub(&amp;#039;_&amp;#039;, &amp;#039;-&amp;#039;) --replace underscores with dashes in language codes&lt;br /&gt;
				&lt;br /&gt;
				if site_info.badges and tail==&amp;#039;&amp;#039; then --continue if page has any badges and it is wikipedia (not other project)&lt;br /&gt;
					--if badge has values &amp;#039;good article&amp;#039;, &amp;#039;good list&amp;#039; or &amp;#039;recommended article&amp;#039;, then add the page to the list of good articles&lt;br /&gt;
					if (site_info.badges[1]==&amp;#039;Q17437798&amp;#039; or site_info.badges[1]==&amp;#039;Q51759403&amp;#039; or site_info.badges[1]==&amp;#039;Q17559452&amp;#039;) then&lt;br /&gt;
						table.insert(good, &amp;#039;[[:&amp;#039;..language_code..&amp;#039;:&amp;#039;..site_info.title..&amp;#039;|&amp;#039;..language_code..&amp;#039;]]&amp;#039;)&lt;br /&gt;
					--if badge has values &amp;#039;featured article&amp;#039; or &amp;#039;featured list&amp;#039;, then add the page to the list of featured articles&lt;br /&gt;
					elseif site_info.badges and (site_info.badges[1]==&amp;#039;Q17437796&amp;#039; or site_info.badges[1]==&amp;#039;Q17506997&amp;#039;) then&lt;br /&gt;
						table.insert(featured, &amp;#039;[[:&amp;#039;..language_code..&amp;#039;:&amp;#039;..site_info.title..&amp;#039;|&amp;#039;..language_code..&amp;#039;]]&amp;#039;)&lt;br /&gt;
					else end --if badge matches none of those values, just skip it&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		--make a row for the current page&lt;br /&gt;
		table.insert(res, &amp;#039;|-\n| [[:en:&amp;#039;..page_title..&amp;#039;]]\n| &amp;#039;..table.concat(good, &amp;#039;, &amp;#039;)..&amp;#039;\n| &amp;#039;..table.concat(featured, &amp;#039;, &amp;#039;)..&amp;#039;\n&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.insert(res, &amp;#039;|}&amp;#039;) --insert table ending&lt;br /&gt;
	return frame:preprocess(table.concat(res)); --return the resulting string, which we get by joining all string in the &amp;#039;res&amp;#039; table&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p; --return object&lt;/div&gt;</summary>
		<author><name>imported&gt;Pietrasagh</name></author>
	</entry>
</feed>