<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thegoonshow.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASpoken_Wikipedia</id>
	<title>Module:Spoken Wikipedia - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.thegoonshow.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASpoken_Wikipedia"/>
	<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spoken_Wikipedia&amp;action=history"/>
	<updated>2026-05-14T07:17:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spoken_Wikipedia&amp;diff=3233&amp;oldid=prev</id>
		<title>Kurt: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spoken_Wikipedia&amp;diff=3233&amp;oldid=prev"/>
		<updated>2022-07-21T17:57:19Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:57, 21 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spoken_Wikipedia&amp;diff=3232&amp;oldid=prev</id>
		<title>en&gt;Andrybak: make formatting consistent: place &quot;do&quot; also on the same line, as &quot;then&quot; was placed in the previous diff; clean up whitespace: remove unnecessary empty line and replace tab in the middle of the line with a space</title>
		<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spoken_Wikipedia&amp;diff=3232&amp;oldid=prev"/>
		<updated>2021-02-27T10:32:40Z</updated>

		<summary type="html">&lt;p&gt;make formatting consistent: place &amp;quot;do&amp;quot; also on the same line, as &amp;quot;then&amp;quot; was placed in the previous diff; clean up whitespace: remove unnecessary empty line and replace tab in the middle of the line with a space&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
local Date = require('Module:Date')._Date&lt;br /&gt;
local lang = mw.language.new('en')&lt;br /&gt;
local cfg = mw.loadData('Module:Spoken Wikipedia/configuration')&lt;br /&gt;
&lt;br /&gt;
p = {}&lt;br /&gt;
&lt;br /&gt;
local function wikiError(message)&lt;br /&gt;
	local ret = mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.err)&lt;br /&gt;
		:wikitext(message)&lt;br /&gt;
		:done()&lt;br /&gt;
	return tostring(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function category(c, nocat)&lt;br /&gt;
	if nocat then&lt;br /&gt;
		return ''&lt;br /&gt;
	else&lt;br /&gt;
		return c&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatPageText(page)&lt;br /&gt;
	if page then&lt;br /&gt;
		return '&amp;lt;span class=&amp;quot;fn&amp;quot;&amp;gt;[[' .. page .. ']]&amp;lt;/span&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
	if mw.title.getCurrentTitle().namespace == 0 then&lt;br /&gt;
		return cfg.i18n.this_article&lt;br /&gt;
	else&lt;br /&gt;
		return cfg.i18n.this_page&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatFileLength(filenames)&lt;br /&gt;
	local length = 0&lt;br /&gt;
	for _, filename in ipairs(filenames) do&lt;br /&gt;
		local fileTitle = mw.title.new(filename, 'Media')&lt;br /&gt;
		if fileTitle and fileTitle.file and fileTitle.file.exists then&lt;br /&gt;
			length = length + fileTitle.file.length&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add 30 to offset the rounding down&lt;br /&gt;
	local intervals = lang:getDurationIntervals(length + 30, { 'hours', 'minutes' })&lt;br /&gt;
	local ret = string.format(&lt;br /&gt;
		'&amp;lt;span class=&amp;quot;min&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt; %s',&lt;br /&gt;
		intervals.minutes or 0,&lt;br /&gt;
		intervals.minutes == 1 and cfg.i18n.minute or cfg.i18n.minutes&lt;br /&gt;
	)&lt;br /&gt;
	if intervals.hours then&lt;br /&gt;
		ret = string.format(&lt;br /&gt;
			'&amp;lt;span class=&amp;quot;h&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt; %s and %s',&lt;br /&gt;
			intervals.hours,&lt;br /&gt;
			intervals.hours == 1 and cfg.i18n.hour or cfg.i18n.hours,&lt;br /&gt;
			ret&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	return '&amp;lt;span class=&amp;quot;duration&amp;quot;&amp;gt;' .. ret .. '&amp;lt;/span&amp;gt;'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatHeader(filenames, page)&lt;br /&gt;
	local listento = mw.html.create('span')&lt;br /&gt;
		:addClass(cfg.i18n.class.listento)&lt;br /&gt;
		:wikitext(string.format(&lt;br /&gt;
			cfg.i18n.listento,&lt;br /&gt;
			formatPageText(page)&lt;br /&gt;
		))&lt;br /&gt;
		:done()&lt;br /&gt;
	&lt;br /&gt;
	local file_length&lt;br /&gt;
	if #filenames &amp;gt; 1 then&lt;br /&gt;
		file_length = string.format(&lt;br /&gt;
			cfg.i18n.n_files_length,&lt;br /&gt;
			tostring(#filenames),&lt;br /&gt;
			formatFileLength(filenames)&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		file_length = string.format(&lt;br /&gt;
			cfg.i18n.one_file_length,&lt;br /&gt;
			formatFileLength(filenames)&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	return mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.header)&lt;br /&gt;
		:node(listento)&lt;br /&gt;
		:wikitext(file_length)&lt;br /&gt;
		:done()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatIcon()&lt;br /&gt;
	return mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.icon)&lt;br /&gt;
		:wikitext(cfg.i18n.icon)&lt;br /&gt;
		:done()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatFiles(filenames, nocat)&lt;br /&gt;
	if #filenames == 0 then&lt;br /&gt;
		return wikiError(cfg.i18n.err.no_filename) ..&lt;br /&gt;
			category(cfg.i18n.cat.no_filename, nocat)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- TODO: the else branch really wants to be a mw.html &amp;lt;ol&amp;gt; object rather than wikitext&lt;br /&gt;
	-- version of the same, so that we can style the numbers nicer&lt;br /&gt;
	local files = {}&lt;br /&gt;
	if #filenames == 1 then&lt;br /&gt;
		table.insert(files, string.format(cfg.i18n.one_file, filenames[1]))&lt;br /&gt;
	else&lt;br /&gt;
		for i, filename in ipairs(filenames) do&lt;br /&gt;
			table.insert(files, string.format(cfg.i18n.n_files, filename, i))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.files)&lt;br /&gt;
		:wikitext(table.concat(files))&lt;br /&gt;
		:done()&lt;br /&gt;
		:newline()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatDateText(frame, dateArg, nocat)&lt;br /&gt;
	local d = dateArg and Date(dateArg) or nil&lt;br /&gt;
	return d and frame:expandTemplate{&lt;br /&gt;
		title = 'Start date', args = {&lt;br /&gt;
			d.year,&lt;br /&gt;
			d.month,&lt;br /&gt;
			d.day,&lt;br /&gt;
			df='y'&lt;br /&gt;
		}&lt;br /&gt;
	} or (wikiError(cfg.i18n.err.no_date) .. category(cfg.i18n.cat.no_date, nocat))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatDisclaimer(frame, filenames, page, dateArg, nocat)&lt;br /&gt;
	local thisFileText = ''&lt;br /&gt;
	local disclaimer&lt;br /&gt;
	if #filenames == 1 then&lt;br /&gt;
		thisFileText = filenames[1]&lt;br /&gt;
		disclaimer = cfg.i18n.one_file_disclaimer&lt;br /&gt;
	else&lt;br /&gt;
		disclaimer = cfg.i18n.n_files_disclaimer&lt;br /&gt;
	end&lt;br /&gt;
	return mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.disclaimer)&lt;br /&gt;
		:wikitext(string.format(&lt;br /&gt;
			disclaimer,&lt;br /&gt;
			thisFileText,&lt;br /&gt;
			formatPageText(page),&lt;br /&gt;
			formatDateText(frame, dateArg, nocat)&lt;br /&gt;
		))&lt;br /&gt;
		:done()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatFooter()&lt;br /&gt;
	return mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.footer)&lt;br /&gt;
		:wikitext(cfg.i18n.footer)&lt;br /&gt;
		:done()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatTopicon(frame, filenames)&lt;br /&gt;
	local wikilink&lt;br /&gt;
	if #filenames &amp;gt; 0 then&lt;br /&gt;
		wikilink = 'File:' .. filenames[1]&lt;br /&gt;
	else&lt;br /&gt;
		wikilink = cfg.i18n.topicon_multiwikilink&lt;br /&gt;
	end&lt;br /&gt;
	return frame:expandTemplate{&lt;br /&gt;
		title = &amp;quot;Top icon&amp;quot;,&lt;br /&gt;
		args = {&lt;br /&gt;
			imagename = 'Sound-icon.svg',&lt;br /&gt;
			wikilink = wikilink,&lt;br /&gt;
			text = 'Listen to this article',&lt;br /&gt;
			id = 'spoken-icon'&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function extractFilenames(args)&lt;br /&gt;
	local filenames = {}&lt;br /&gt;
	for key, rawValue in ipairs(args) do&lt;br /&gt;
		local value = mw.text.trim(rawValue)&lt;br /&gt;
		if type(key) == &amp;quot;number&amp;quot; and value ~= '' then&lt;br /&gt;
			table.insert(filenames, value)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return filenames&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function sidebox(nodes)&lt;br /&gt;
	root = mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.box)&lt;br /&gt;
	for _, node in ipairs(nodes) do&lt;br /&gt;
		root:node(node)&lt;br /&gt;
	end&lt;br /&gt;
	return root&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
&lt;br /&gt;
	-- Mandatory parameters&lt;br /&gt;
	local filenames = extractFilenames(args)&lt;br /&gt;
	local dateArg = args['date']&lt;br /&gt;
	-- Optional parameters&lt;br /&gt;
	local page = args['page']&lt;br /&gt;
	local nocat = yesno(args['nocat'], false) or false&lt;br /&gt;
&lt;br /&gt;
	local root = sidebox({&lt;br /&gt;
		formatHeader(filenames, page),&lt;br /&gt;
		formatFiles(filenames, nocat),&lt;br /&gt;
		formatIcon(),&lt;br /&gt;
		formatDisclaimer(frame, filenames, page, dateArg, nocat),&lt;br /&gt;
		formatFooter()&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	if mw.title.getCurrentTitle().namespace == 0 then&lt;br /&gt;
		root:wikitext(formatTopicon(frame, filenames))&lt;br /&gt;
		root:wikitext(category(cfg.i18n.cat.articles, nocat))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return frame:extensionTag{&lt;br /&gt;
		name = 'templatestyles', args = { src = cfg.templatestyles }&lt;br /&gt;
	} .. tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.main = main&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en&gt;Andrybak</name></author>
	</entry>
</feed>