User:Keller999/projects/gamepageupdate: Difference between revisions

Jump to navigation Jump to search
m (→‎Version 1.02 Updated: Comment cleanup for things that we've either agreed not to fix, or have been fixed.)
(Update to 1.02.3)
Line 96: Line 96:


print "************************************\n";
print "************************************\n";
print "* Dolphin Wiki Page Update v1.02.2 *\n";
print "* Dolphin Wiki Page Update v1.02.3 *\n";
print "************************************\n\n";
print "************************************\n\n";


Line 120: Line 120:


print "************************************\n";
print "************************************\n";
print "* Dolphin Wiki Page Update v1.02.2 *\n";
print "* Dolphin Wiki Page Update v1.02.3 *\n";
print "************************************\n\n";
print "************************************\n\n";


Line 159: Line 159:
if ($newLine =~ /^\{\{\ *Infobox.*/i) {  # This is the start of the Infobox, ignore
if ($newLine =~ /^\{\{\ *Infobox.*/i) {  # This is the start of the Infobox, ignore
# ignore
# ignore
} elsif ($newLine =~ /^\}\}$/) {  # This is the end of the Infobox, change section and ignore
} elsif (($newLine =~ /^\}\}$/) or ($newLine =~ /^.*\}{4}$/)) {  # This is the end of the Infobox, change section and ignore
$currentSection = "description";
$currentSection = "description";
} else {  # We want to keep anything else in the infobox.  This is in case the user didn't give us a wikipedia article to generate a new one from
} else {  # We want to keep anything else in the infobox.  This is in case the user didn't give us a wikipedia article to generate a new one from
Line 169: Line 169:
$image = $newLine;
$image = $newLine;
# just keep the filename, and format  
# just keep the filename, and format  
$image =~ s/\|image\ *\=\ *\[\[(?:File|Image)\ *\:\ *(.*?)(?:\||\]){1,2}.*/$1/i;
$image =~ s/\|image\ *\=\ *\[\[(?:File|Image)\ *\:\ *(.+?\..+?)(?:\||\]|\.){1,2}.*/$1/i;
} elsif ($newLine =~ /^\|\ *size\ *=\ *.+/gi) {
} elsif ($newLine =~ /^\|\ *size\ *=\ *.+/gi) {
$savedSizeLine = $newLine; # saved for later
$savedSizeLine = $newLine; # saved for later
Line 266: Line 266:


#Wii
#Wii
if ($newLine =~ /.*Wii.*/i) {
if ($newLine =~ /.*Wii(\s|\||\]|\,)/i) {
$platforms .= '[[Wii]] ';
$platforms .= '[[Wii]] ';
if (@autoCategory eq 0) { push (@autoCategory, '[[Category:Pages with automatically-added categories that have not been verified]]'); }
if (@autoCategory eq 0) { push (@autoCategory, '[[Category:Pages with automatically-added categories that have not been verified]]'); }
Line 324: Line 324:


# If the parameter is not in our list, it's ignored
# If the parameter is not in our list, it's ignored
if ($newLine =~ /^\|\ *(title|developer|publisher|distributor|director|producer|designer|programmer|artist|composer|license|series|engine|resolution|released|genre|mode|ratings|size|fps|dspcode|dtkadpcm|channeltype|mode|modes)\ *=\ *.{2,}/gi) {
if ($newLine =~ /^\|\ *(title|developer|publisher|distributor|director|producer|designer|programmer|artist|composer|license|series|engine|resolution|released|genre|mode|ratings|size|dspcode|dtkadpcm|channeltype|mode|modes)\ *=\ *.{2,}/gi) {
$skip = 0;
$skip = 0;
$newLine =~ s/^\|(\S*)\ *=\ *(.*)/\|$1 \= $2/i;
$newLine =~ s/^\|(\S*)\ *=\ *(.*)/\|$1 \= $2/i;
Line 372: Line 372:




if ($line ne "") {
if (($line ne "") and (not($line =~ /.*single.*/i))) {
$line =~ s/(\<.+?\>)|\(|\)/\,/gi;
$line =~ s/(\<.+?\>)|\(|\)/\,/gi;
$line =~ s/^\ *//;
$line =~ s/^\ *//;
Line 403: Line 403:
$newLine =~ s/GameCube/[[GameCube]]/i;
$newLine =~ s/GameCube/[[GameCube]]/i;
$newLine =~ s/Nintendo GameCube/[[GameCube]]/i;
$newLine =~ s/Nintendo GameCube/[[GameCube]]/i;
$newLine =~ s/\ Wii\ /[[Wii]]/i;
$newLine =~ s/\ Wii\ / [[Wii]] /i;
$newLine =~ s/WiiWare/[[WiiWare]]/i;
$newLine =~ s/WiiWare/[[WiiWare]]/i;
$newLine =~ s/Virtual Console/[[Virtual Console]]/i;
$newLine =~ s/Virtual Console/[[Virtual Console]]/i;