<?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%3AVideo_game_series_reviews</id>
	<title>Module:Video game series reviews - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AVideo_game_series_reviews"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Video_game_series_reviews&amp;action=history"/>
	<updated>2026-06-20T01:04:27Z</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:Video_game_series_reviews&amp;diff=479979&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:Video_game_series_reviews&amp;diff=479979&amp;oldid=prev"/>
		<updated>2021-07-16T07:56:05Z</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;local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
local Vgwd = require('Module:Video game wikidata')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local columns = {&lt;br /&gt;
	['mc'] = nil,&lt;br /&gt;
	['gr'] = nil,&lt;br /&gt;
	['fam'] = nil,&lt;br /&gt;
	['sales'] = nil,&lt;br /&gt;
	['year'] = nil,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function sortByNumber(a,b)&lt;br /&gt;
	return a['num'] &amp;lt; b['num']&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
local function sortByPublicationDate(a,b)&lt;br /&gt;
	local aP = a['pubDate'];&lt;br /&gt;
	local bP = b['pubDate'];&lt;br /&gt;
	if(aP ~= nil and bP ~= nil) then&lt;br /&gt;
		return aP &amp;lt; bP;&lt;br /&gt;
	end;&lt;br /&gt;
	&lt;br /&gt;
	-- fallback sorting, let's assume the oldest wikidata entity is the oldest game&lt;br /&gt;
	local aQ = a['qid'];&lt;br /&gt;
	local bQ = b['qid'];&lt;br /&gt;
	if(aQ ~= nil and bQ ~= nil) then&lt;br /&gt;
		return aQ &amp;lt; bQ;&lt;br /&gt;
	end;&lt;br /&gt;
	&lt;br /&gt;
	-- still nothing? okay, let's just use the initial order&lt;br /&gt;
	return a['num'] &amp;lt; b['num'];&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
local function getVGWD(frame, reviewer)&lt;br /&gt;
	-- Obey local override on displaying this reviewer, don't bother trying to get Wikidata.&lt;br /&gt;
	if(columns[reviewer] == false) then&lt;br /&gt;
		return nil;&lt;br /&gt;
	end;&lt;br /&gt;
&lt;br /&gt;
	local vgwdScore = Vgwd.setReviewer(reviewer);&lt;br /&gt;
	if(vgwdScore ~= nil) then&lt;br /&gt;
		return vgwdScore;&lt;br /&gt;
	end;&lt;br /&gt;
	&lt;br /&gt;
	-- Because a game with no platforms may disable show system, we have to reenable for each game.&lt;br /&gt;
	Vgwd.setShowSystem(true);	&lt;br /&gt;
&lt;br /&gt;
	return Vgwd.printReviewScores(frame);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
local function checkColumn(game, column)&lt;br /&gt;
	if(game[column] ~= nil and game[column] ~= &amp;quot;&amp;quot; and columns[column] ~= false) then&lt;br /&gt;
		columns[column] = true;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
local function buildGameEntry(args, num, qid)&lt;br /&gt;
	local game = {}&lt;br /&gt;
	game['num'] = num;&lt;br /&gt;
	game['name'] = args[&amp;quot;game&amp;quot;..num];&lt;br /&gt;
	game['mc'] = args[&amp;quot;mc&amp;quot;..num];&lt;br /&gt;
	game['gr'] = args[&amp;quot;gr&amp;quot;..num];&lt;br /&gt;
	game['fam'] = args[&amp;quot;fam&amp;quot;..num];&lt;br /&gt;
	game['sales'] = args[&amp;quot;sales&amp;quot;..num];&lt;br /&gt;
	game['year'] = args[&amp;quot;year&amp;quot;..num];	&lt;br /&gt;
	if(qid ~= nil) then&lt;br /&gt;
		-- If a qid was supplied, we are doing a series pull and won't check columns here.&lt;br /&gt;
		game['qid'] = qid;		&lt;br /&gt;
	else&lt;br /&gt;
		-- Pulling game data purely from arguments, so check columns.&lt;br /&gt;
		game['qid'] = args[&amp;quot;qid&amp;quot;..num];&lt;br /&gt;
		checkColumn(game, 'gr');&lt;br /&gt;
		checkColumn(game, 'fam');&lt;br /&gt;
		checkColumn(game, 'mc');&lt;br /&gt;
		checkColumn(game, 'year');&lt;br /&gt;
		checkColumn(game, 'sales');			&lt;br /&gt;
	end;&lt;br /&gt;
&lt;br /&gt;
	return game;&lt;br /&gt;
end;	&lt;br /&gt;
&lt;br /&gt;
local function buildGameWikidata(frame, game)&lt;br /&gt;
	if(game['qid'] ~= nil) then&lt;br /&gt;
		local vgwdScore = Vgwd.setGame(game[&amp;quot;qid&amp;quot;]);&lt;br /&gt;
		if(vgwdScore == nil) then&lt;br /&gt;
			game['updateLink'] = Vgwd.getUpdateLink();&lt;br /&gt;
			if(game['mc'] == nil) then&lt;br /&gt;
				game['mc'] = getVGWD(frame, 'mc')&lt;br /&gt;
			end;&lt;br /&gt;
			if(game['gr'] == nil and columns['gr']) then&lt;br /&gt;
				game['gr'] = getVGWD(frame, 'gr')&lt;br /&gt;
			end;&lt;br /&gt;
			if(game['fam'] == nil and columns['fam']) then&lt;br /&gt;
				game['fam'] = getVGWD(frame, 'fam')&lt;br /&gt;
			end;&lt;br /&gt;
			if(game['name'] == nil) then&lt;br /&gt;
				local sitelink = Vgwd.getSitelink();&lt;br /&gt;
				local label = Vgwd.getLabel();&lt;br /&gt;
				if(sitelink ~= nil) then&lt;br /&gt;
					if(sitelink ~= label) then&lt;br /&gt;
						game['name'] = &amp;quot;[[&amp;quot; .. sitelink .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;;&lt;br /&gt;
					else&lt;br /&gt;
						game['name'] = &amp;quot;[[&amp;quot; .. sitelink .. &amp;quot;]]&amp;quot;;									&lt;br /&gt;
					end;&lt;br /&gt;
				else&lt;br /&gt;
					game['name'] = label;&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
			if(game['year'] == nil) then&lt;br /&gt;
				local pubDate = Vgwd.getEarliestPublicationDate();&lt;br /&gt;
				game['pubDate'] = pubDate;&lt;br /&gt;
				if(pubDate ~= nil) then&lt;br /&gt;
					game['year'] = pubDate.year;&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
		else&lt;br /&gt;
			-- Entity wasn't found... How to represent? TODO.&lt;br /&gt;
		end;&lt;br /&gt;
	end;&lt;br /&gt;
				&lt;br /&gt;
	-- We don't check GR and FAM because they must be explicitly enabled by arguments.&lt;br /&gt;
	checkColumn(game, 'mc');&lt;br /&gt;
	checkColumn(game, 'year');&lt;br /&gt;
	checkColumn(game, 'sales');&lt;br /&gt;
	&lt;br /&gt;
	return game;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._main(frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(frame, args)&lt;br /&gt;
	-- Get specified values of column display parameters. Nil = Unspecified.&lt;br /&gt;
	if(args[&amp;quot;mc&amp;quot;]) then&lt;br /&gt;
		columns['mc'] = yesno(args.mc);&lt;br /&gt;
	end&lt;br /&gt;
	if(args[&amp;quot;gr&amp;quot;]) then&lt;br /&gt;
		columns['gr'] = yesno(args.gr);&lt;br /&gt;
	end	&lt;br /&gt;
	if(args[&amp;quot;fam&amp;quot;]) then&lt;br /&gt;
		columns['fam'] = yesno(args.fam);&lt;br /&gt;
	end		&lt;br /&gt;
	if(args[&amp;quot;sales&amp;quot;]) then&lt;br /&gt;
		columns['sales'] = yesno(args.sales);&lt;br /&gt;
	end			&lt;br /&gt;
	if(args[&amp;quot;years&amp;quot;]) then&lt;br /&gt;
		columns['year'] = yesno(args.years);&lt;br /&gt;
	end			&lt;br /&gt;
	&lt;br /&gt;
	local seriesQid = args[&amp;quot;seriesQid&amp;quot;]; -- Should be nil, but for testing we have to be able to supply one.&lt;br /&gt;
	&lt;br /&gt;
	Vgwd.setDateFormat(args[&amp;quot;df&amp;quot;]);&lt;br /&gt;
	Vgwd.setSystem(nil);&lt;br /&gt;
	Vgwd.setGenerateReferences(true);&lt;br /&gt;
	Vgwd.setShowUpdateLink(false);&lt;br /&gt;
	Vgwd.setUpdateLinkStyle(&amp;quot;pen&amp;quot;);&lt;br /&gt;
	&lt;br /&gt;
	local games = {};&lt;br /&gt;
	local gameRead = {};&lt;br /&gt;
	&lt;br /&gt;
	-- Look for locally provided gameN and qidN parameters first. Build a table containing all the arguments.&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if(string.find(k, &amp;quot;game%d+&amp;quot;) or string.find(k, &amp;quot;qid%d+&amp;quot;)) then&lt;br /&gt;
			local num = tonumber(string.match(k, &amp;quot;%d+&amp;quot;))&lt;br /&gt;
			if(num ~= nil) then&lt;br /&gt;
				if(gameRead[num] == nil) then&lt;br /&gt;
					gameRead[num] = true;&lt;br /&gt;
					table.insert(games, buildGameEntry(args,num));&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
		end;		&lt;br /&gt;
	end;&lt;br /&gt;
&lt;br /&gt;
	-- Did we find any games specified on the arguments?&lt;br /&gt;
	if(#games &amp;gt; 0) then&lt;br /&gt;
		-- Sort by entry.&lt;br /&gt;
		table.sort(games, sortByNumber);&lt;br /&gt;
		&lt;br /&gt;
		-- Retrieve missing data with Wikidata if possible, for each entry.&lt;br /&gt;
		for i, game in ipairs(games) do&lt;br /&gt;
			games[i] = buildGameWikidata(frame,game);&lt;br /&gt;
		end;&lt;br /&gt;
	else&lt;br /&gt;
		-- If we didn't get any games from the arguments, try to pull the parts of the series from Wikidata.&lt;br /&gt;
		-- Reset vgwd to current page, presumably a series.&lt;br /&gt;
		local vgwdScore = Vgwd.setGame(seriesQid);&lt;br /&gt;
		if(vgwdScore == nil) then&lt;br /&gt;
			local parts = Vgwd.getParts();&lt;br /&gt;
			for i, qid in ipairs(parts) do&lt;br /&gt;
				-- Build an entry.&lt;br /&gt;
				local game = buildGameEntry({},i,qid)&lt;br /&gt;
				&lt;br /&gt;
				-- Retrieve the data from Wikidata and store in the table.&lt;br /&gt;
				table.insert(games, buildGameWikidata(frame,game));&lt;br /&gt;
			end;&lt;br /&gt;
			&lt;br /&gt;
			table.sort(games, sortByPublicationDate);&lt;br /&gt;
		else&lt;br /&gt;
			-- Entity wasn't found... How to represent? TODO.&lt;br /&gt;
		end;&lt;br /&gt;
	end;&lt;br /&gt;
&lt;br /&gt;
	local ret = &amp;quot;{| class=\&amp;quot;wikitable plainrowheaders\&amp;quot; style=\&amp;quot;font-size: 90%; float: right; clear: right; margin:0.5em 0 0.5em 1em;\&amp;quot;\n&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	ret = ret ..&amp;quot;|+ style=\&amp;quot;font-size: 111.11%;\&amp;quot; | &amp;quot;&lt;br /&gt;
	if args.title then&lt;br /&gt;
		ret = ret .. args.title&lt;br /&gt;
	elseif columns['sales'] then&lt;br /&gt;
		if columns['fam'] then&lt;br /&gt;
			ret = ret .. &amp;quot;Sales and review scores&amp;quot;&lt;br /&gt;
		elseif columns['gr'] or columns['mc'] then&lt;br /&gt;
			ret = ret .. &amp;quot;Sales and aggregate review scores&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			ret = ret .. &amp;quot;Sales&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif columns['fam'] then&lt;br /&gt;
		if columns['gr'] or columns['mc'] then&lt;br /&gt;
			ret = ret .. &amp;quot;Japanese and Western review scores&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			ret = ret .. &amp;quot;Famitsu review scores&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		ret = ret .. &amp;quot;Aggregate review scores&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.updated then&lt;br /&gt;
		ret = ret .. &amp;quot;&amp;lt;br /&amp;gt;&amp;lt;small&amp;gt;''As of &amp;quot; .. args.updated ..&amp;quot;.''&amp;lt;/small&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	ret = ret .. &amp;quot; \n&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	ret = ret .. &amp;quot;! scope=\&amp;quot;col\&amp;quot; | Game \n&amp;quot;&lt;br /&gt;
	if columns['year'] then&lt;br /&gt;
		ret = ret .. &amp;quot;! scope=\&amp;quot;col\&amp;quot; | Year\n&amp;quot;&lt;br /&gt;
	end	&lt;br /&gt;
	if columns['sales'] then&lt;br /&gt;
		ret = ret .. &amp;quot;! scope=\&amp;quot;col\&amp;quot; | &amp;quot; .. (args.sales_title or &amp;quot;Units sold&amp;quot;) .. &amp;quot; \n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if columns['fam'] then&lt;br /&gt;
		ret = ret .. &amp;quot;! scope=\&amp;quot;col\&amp;quot; | &amp;quot; .. (args.fam_title or  &amp;quot;''[[Famitsu scores|Famitsu]]''&amp;quot;) .. &amp;quot; \n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if columns['gr'] then&lt;br /&gt;
		ret = ret .. &amp;quot;! scope=\&amp;quot;col\&amp;quot; | &amp;quot; .. (args.gr_title or  &amp;quot;[[GameRankings]]&amp;quot;) .. &amp;quot; \n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if columns['mc'] then&lt;br /&gt;
		ret = ret .. &amp;quot;! scope=\&amp;quot;col\&amp;quot; | &amp;quot; .. (args.mc_title or  &amp;quot;[[Metacritic]]&amp;quot;) .. &amp;quot; \n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Print the reviews&lt;br /&gt;
    for i,game in ipairs(games) do&lt;br /&gt;
		ret = ret .. &amp;quot;|-\n&amp;quot;&lt;br /&gt;
		ret = ret .. &amp;quot;! scope=\&amp;quot;row\&amp;quot; | ''&amp;quot; .. game['name'] .. &amp;quot;''&amp;quot;&lt;br /&gt;
		if(game['updateLink']) then&lt;br /&gt;
			ret = ret .. &amp;quot; &amp;quot; .. game['updateLink'];&lt;br /&gt;
		end;&lt;br /&gt;
		ret = ret .. &amp;quot;\n&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
		if columns['year'] then&lt;br /&gt;
			ret = ret .. &amp;quot;| style=\&amp;quot;text-align: center;\&amp;quot; | &amp;quot; .. (game['year'] or '') .. &amp;quot; \n&amp;quot;&lt;br /&gt;
		end	&lt;br /&gt;
		if columns['sales'] then&lt;br /&gt;
			ret = ret .. &amp;quot;| style=\&amp;quot;text-align: center;\&amp;quot; | &amp;quot; .. (game['sales'] or '') .. &amp;quot; \n&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if columns['fam'] then&lt;br /&gt;
			ret = ret .. &amp;quot;| style=\&amp;quot;text-align: center;\&amp;quot; | &amp;quot; .. (game['fam'] or '') .. &amp;quot; \n&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if columns['gr'] then&lt;br /&gt;
			ret = ret .. &amp;quot;| style=\&amp;quot;text-align: center;\&amp;quot; | &amp;quot; .. (game['gr'] or '') .. &amp;quot; \n&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if columns['mc'] then&lt;br /&gt;
			ret = ret .. &amp;quot;| style=\&amp;quot;text-align: center;\&amp;quot; | &amp;quot; .. (game['mc'] or '') .. &amp;quot; \n&amp;quot;&lt;br /&gt;
		end	&lt;br /&gt;
	end;&lt;br /&gt;
&lt;br /&gt;
	ret = ret .. &amp;quot;|}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>