User:AnomieBOT/source/tasks/POTDPageCreator.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: General: * Update for the addition of 'rvslots'. DatedCategoryDeleterTest: * Disable. It's clear that task won't be needed. BrokenRedirectDeleter: * Handle pages with newlines before the <code>#REDIRECT</code>.
AnomieBOT (talk | contribs)
Updating published sources: POTDPageCreator: * Adjust edit summary because someone complained it wasn't obvious enough where things were being substed from.
Line 85:
}
 
push @edits, [ $page2, $tok2, $outtxt2, "Creating protected version of a [[WP:POTD]] template by substing from {{[[$srcpage2|POTD/$date/$i]]|row}}" ];
}
 
push @edits, [ $page, $tok, $outtxt, "Creating protected version of a [[WP:POTD]] template by adjusting [[$srcpage]]" ];
} elsif ( $outtxt=~s/^\s*\Q{{POTD {{{1|{{{style|default}}}}}}\E\s*\n/{{subst:POTD row\n/ ) {
push @edits, [ $page, $tok, $outtxt, "Creating protected version of a [[WP:POTD]] template by substing from {{[[$srcpage|POTD/$date]]|row}}" ];
} else {
$api->warn( "$srcpage doesn't begin with expected wikitext\n$outtxt" );
Line 98:
 
foreach my $edit (@edits) {
my ($page, $tok, $outtxt, $summary) = @$edit;
my $res = $api->edit($tok, $outtxt, 'Creating protected version of a [[WP:POTD]] template'$summary, 0, 1);
if($res->{'code'} ne 'success'){
$api->warn("Write for $page failed: " . $res->{'error'});