Content deleted Content added
Updating published sources: AFDMergeFromCleaner: * Don't count it as a problem when A redirects to C where it is "supposed" to redirect to B if B is a redirect to C. diff.pl: * Open the pipe as utf8 so diffs don't have mangled characters. |
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>. |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1:
{{ombox|type=notice|text= Approved 2009-01-03<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 20]]}}
<
package tasks::AFDMergeFromCleaner;
Line 7:
=begin metadata
Bot: AnomieBOT
Task: AFDMergeFromCleaner
BRFA: Wikipedia:Bots/Requests for approval/AnomieBOT 20
Status: Approved 2009-01-03
Created: 2008-12-29
Remove instances of {{tl|afd-
Report instances of {{tl|afd-
to a different target.
Line 61:
return $t if $t>0;
my @templates=('Afd-
my $screwup=' Errors? [[User:'.$api->user.'/shutoff/AFDMergeFromCleaner]]';
my $report='User:'.$api->user.'/Afd-mergefrom report';
# Get a list of templates redirecting to our targets
my %templates=$api->redirects_to_resolved(map "Template:$_", @templates);
$api->warn("Failed to get redirects to target templates: ".$templates{''}{'error'}."\n");
}
Line 149 ⟶ 143:
# Get page text
my $intxt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
# First, find the template and pull out the relevant parameter
Line 241 ⟶ 235:
last;
}
my $intxt=
foreach my $s (split(/(?=(?:^|\n)==)/, $intxt)){
if($s=~/^\n?==\s*Redirected\s*==/){
Line 261 ⟶ 255:
}
my $outtxt="== Redirected ==\n";
$outtxt.="The following table lists pages referred to by {{tl|afd-
$outtxt.="{| class=\"wikitable sortable\"\n";
$outtxt.="! Page !! AFD merge to !! Redirect to !! Note\n";
Line 268 ⟶ 262:
$outtxt.="\n|}\n\n";
$outtxt.="== Deleted ==\n";
$outtxt.="The following table lists deleted pages that were referred to by {{tl|afd-
$outtxt.="{| class=\"wikitable sortable\"\n";
$outtxt.="! Page !! AFD merge to !! Note\n";
Line 295 ⟶ 289:
1;
</syntaxhighlight>
|