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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: SourceUploader: * Sort directory pages by last modified date. * Use <nowiki><syntaxhighlight></nowiki> instead of <nowiki><source></nowiki>. d::NoWiki: * Add support for <nowiki><syntaxhighlight></nowiki>. General: * Vario
AnomieBOT (talk | contribs)
Updating published sources: AutoAssessor2: * Retire this task too, I think Lua now tends to handle this sort of thing.
 
(2 intermediate revisions by the same user not shown)
Line 1:
{{ombox|type=notice|text= Approved 2008-12-07<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 15]]}}
{{ombox|type=notice|text= Retired 2025-02-01. Haven't had call to run this in a while, and I think Lua now handles this sort of thing anyway.}}
<syntaxhighlight lang="perl">
package tasks::AutoAssessor2;
Line 10 ⟶ 11:
Task: AutoAssessor2
BRFA: Wikipedia:Bots/Requests for approval/AnomieBOT 15
Status: ApprovedInactive 20082025-1202-0701
Created: 2008-11-26
OnDemand: true
Line 81 ⟶ 82:
=for info
Approved 2008-12-07<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 15]]
 
=for info
Retired 2025-02-01. Haven't had call to run this in a while, and I think Lua now handles this sort of thing anyway.
 
=cut
Line 92 ⟶ 96:
my $res;
 
$api->task('AutoAssessor2', 0, 10, qw/d::WikiProjectTagging d::Redirects/);
 
# Load configs, if necessary
Line 115 ⟶ 119:
if(!$self->{'did_templates'}){
while(my ($t,$c)=each %cfg_templates){
my %redirs=$capi->{'names'}=[ redirects_to_resolved("Template:$t" ]);
$res=$api->queryif([],exists($redirs{''})){
list$api->warn("Failed to get redirects to => Template:$t".$redirs{''}{'backlinkserror',}."\n");
bltitle => "Template:$t",
blfilterredir => 'redirects',
bllimit => 'max',
);
if($res->{'code'} ne 'success'){
$api->warn("Failed to retrieve redirect list for $t: ".$res->{'error'}."\n");
return 60;
}
push @{$c->{'names'}},=[ $_->{'title'}keys foreach%redirs (@{$res->{'query'}{'backlinks'}})];
}
$self->{'did_templates'}=1;
Line 158 ⟶ 156:
$q2{'prop'}.='|revisions';
$q2{'rvprop'}='content';
if($res->q2{'codervslots'} ne ='successmain'){;
}
 
Line 227 ⟶ 226:
 
# Get page text
my $intxt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
my ($outtxt,$nowiki)=$api->strip_nowiki($intxt);
my $any=0;