User:Keller999/projects/gamepageupdate: Difference between revisions

m
dolphinpageupdate.pl v1.02.6
m (v1.02.5 (minor bug fix))
m (dolphinpageupdate.pl v1.02.6)
Line 89: Line 89:
'''''1.02.5'''''
'''''1.02.5'''''
* Wii with a non-space will now be properly converted into a wiki link
* Wii with a non-space will now be properly converted into a wiki link
'''''1.02.6'''''
* Preserve spacing in existing descriptions (still needs some work, double spacing is not kept)
* Spacing adjustments
* Improvement on the default infobox (which is broken at the moment, working on that)


<pre>
<pre>
Line 107: Line 111:


print "************************************\n";
print "************************************\n";
print "* Dolphin Wiki Page Update v1.02.5 *\n";
print "* Dolphin Wiki Page Update v1.02.6 *\n";
print "************************************\n\n";
print "************************************\n\n";


Line 131: Line 135:


print "************************************\n";
print "************************************\n";
print "* Dolphin Wiki Page Update v1.02.5 *\n";
print "* Dolphin Wiki Page Update v1.02.6 *\n";
print "************************************\n\n";
print "************************************\n\n";


Line 141: Line 145:
         chomp($line);
         chomp($line);


         if (($line ne "-1") and ($line ne "")) {
         if ($line ne "-1") {
                 push (@originalArticle,$line);
                 push (@originalArticle,$line);
         }
         }
Line 277: Line 281:


#Wii
#Wii
if ($newLine =~ /.*Wii(\s|\||\]|\,)/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 335: Line 339:


# 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|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|dspcode|dtkadpcm|channeltype|mode|modes)\ *=\ *.{2,}/gi) {
$skip = 0;
$skip = 0;
$newLine =~ s/^\|(\S*)\ *=\ *(.*)/\|$1 \= $2/i;
$newLine =~ s/^\|(\S*)\ *=\ *(.*)/\|$1 \= $2/i;
Line 394: Line 398:
}
}


#New-line if this is the end of the Infobox
if ($newLine =~ /^\}\}$/) { #this is the end of the Infobox
if ($newLine =~ /^\}\}$/) {
if ($savedSizeLine ne "") { push (@finalResult, $savedSizeLine); }  # Saved size
if ($savedSizeLine ne "") { push (@finalResult, $savedSizeLine); }  # Saved size
if ($savedInputLine ne "") { push (@finalResult, $savedInputLine); }  # Saved input
if ($savedInputLine ne "") { push (@finalResult, $savedInputLine); }  # Saved input
Line 405: Line 408:


push (@finalResult, $newLine);
push (@finalResult, $newLine);
push (@finalResult, " ");
$skip = 1;
$skip = 1;
$insideInfobox = 0;
$insideInfobox = 0;
Line 450: Line 452:
}
}


if ($compareCatShort eq $shortCat) {
if (lc($compareCatShort) eq lc($shortCat)) {
$dupe = 1;
$dupe = 1;
}
}
Line 467: Line 469:
push (@finalResult, '{{Infobox VG');
push (@finalResult, '{{Infobox VG');
push (@finalResult, '|title = {{SUBPAGENAME}}');
push (@finalResult, '|title = {{SUBPAGENAME}}');
push (@finalResult, '|image = [[File:{{SUBPAGENAME}}.png|');
push (@finalResult, '|image = [[File:{{SUBPAGENAME}}.png|300px]]');
push (@finalResult, '}}');
push (@finalResult, '}}');
}
}
Line 473: Line 475:
#DESCRIPTION PROCESSING
#DESCRIPTION PROCESSING
if ((@descriptionSection) and ($foundWikipediaInfobox eq 0)) {  # Only re-use the original description if there was one and we didn't get Wikipedia data
if ((@descriptionSection) and ($foundWikipediaInfobox eq 0)) {  # Only re-use the original description if there was one and we didn't get Wikipedia data
push (@finalResult, "\n");
push (@finalResult, @descriptionSection);
push (@finalResult, @descriptionSection);
}
}


push (@finalResult, "\n\=\= Problems \=\=");
push (@finalResult, "\=\= Problems \=\=");
push (@finalResult, @problemSection);
push (@finalResult, @problemSection);


1,411

edits