<?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%3ATeam_appearances_list%2Fshow</id>
	<title>Module:Team appearances list/show - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ATeam_appearances_list%2Fshow"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Team_appearances_list/show&amp;action=history"/>
	<updated>2026-06-14T07:53:08Z</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:Team_appearances_list/show&amp;diff=479703&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:Team_appearances_list/show&amp;diff=479703&amp;oldid=prev"/>
		<updated>2021-07-16T07:33:59Z</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;-- For testing, show results using data from [[Module:Team appearances list/data]].&lt;br /&gt;
&lt;br /&gt;
local Collection = {}&lt;br /&gt;
Collection.__index = Collection&lt;br /&gt;
do&lt;br /&gt;
	function Collection:add(item)&lt;br /&gt;
		if item ~= nil then&lt;br /&gt;
			self.n = self.n + 1&lt;br /&gt;
			self[self.n] = item&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	function Collection:join(sep)&lt;br /&gt;
		return table.concat(self, sep)&lt;br /&gt;
	end&lt;br /&gt;
	function Collection:sort(comp)&lt;br /&gt;
		table.sort(self, comp)&lt;br /&gt;
	end&lt;br /&gt;
	function Collection.new()&lt;br /&gt;
		return setmetatable({n = 0}, Collection)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_page_content(page_title)&lt;br /&gt;
	local t = mw.title.new(page_title)&lt;br /&gt;
	if t then&lt;br /&gt;
		local content = t:getContent()&lt;br /&gt;
		if content then&lt;br /&gt;
			if content:sub(-1) ~= '\n' then&lt;br /&gt;
				content = content .. '\n'&lt;br /&gt;
			end&lt;br /&gt;
			return content&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	error('Could not read wikitext from &amp;quot;[[' .. page_title .. ']]&amp;quot;.', 0)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function make_data(modname)&lt;br /&gt;
	-- Return a list of tables for each competition/team in the order used in&lt;br /&gt;
	-- the data module, based on a hope that the data module is consistently&lt;br /&gt;
	-- indented with one tab before competitions and two or more before teams,&lt;br /&gt;
	-- and quotes (&amp;quot;) are used for strings (not apostrophes).&lt;br /&gt;
	local content = get_page_content(modname)&lt;br /&gt;
	local lnum = 0&lt;br /&gt;
	local current_games&lt;br /&gt;
	local items = Collection.new()&lt;br /&gt;
	for line in string.gmatch(content, '(.-)\n') do&lt;br /&gt;
		lnum = lnum + 1&lt;br /&gt;
		local indent, title = line:match('^(\t+)%[&amp;quot;(.-)&amp;quot;%]')&lt;br /&gt;
		if indent then&lt;br /&gt;
			if indent == '\t' then&lt;br /&gt;
				current_games = title&lt;br /&gt;
			else&lt;br /&gt;
				items:add({&lt;br /&gt;
					competition = current_games,&lt;br /&gt;
					team = title,&lt;br /&gt;
					line = lnum,&lt;br /&gt;
				})&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return items&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function main(frame)&lt;br /&gt;
	local title = frame.args[1]&lt;br /&gt;
	if title == nil or title == '' then&lt;br /&gt;
		return 'Error: Parameter 1 must specify name of data module'&lt;br /&gt;
	end&lt;br /&gt;
	local sandbox = title:find('sandbox', 1, true) and '/sandbox' or ''&lt;br /&gt;
	local lister = require('Module:Team appearances list' .. sandbox)._main&lt;br /&gt;
	local lines = Collection.new()&lt;br /&gt;
	local current_games&lt;br /&gt;
	for _, item in ipairs(make_data(title)) do&lt;br /&gt;
		if current_games ~= item.competition then&lt;br /&gt;
			current_games = item.competition&lt;br /&gt;
			lines:add('==' .. current_games .. '==')&lt;br /&gt;
		end&lt;br /&gt;
		lines:add(item.team .. ' (line ' .. item.line .. ') ' .. lister(item))&lt;br /&gt;
	end&lt;br /&gt;
	return lines:join('\n')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return { main = main }&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>