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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: WikiProjectWorker: * Start run for WikiProject California d::WikiProjectTagging: * WPBmin/WPBmax fix for comments in the value.
AnomieBOT (talk | contribs)
Updating published sources: General: * BREAKING CHANGE: Split d::Util into several different modules. * Many tasks updated to use log/debug instead of warn. AnomieBOT::API: * Moved warn back into AnomieBOT::API. * New functions: log, debug, halting *
Line 102:
my $res;
 
$api->task('WikiProjectWorker', 0, 10, qw/d::Util d::WikiProjectTagging/);
my $errto = 'Errors? [[User:'.$api->user.'/shutoff/WikiProjectWorker]]';
 
Line 135:
my $title=filter($page);
if(!defined($title)){
$api->warnlog("Skipping ".$page->{'title'}.", filter returned undef\n");
$api->store->{$pageid}=$seq;
next;
Line 150:
}
if(($tok->{'ns'}&1)==0){
$api->warnlog("Cannot edit $title: namespace ".$tok->{'ns'}." is non-talk\n");
$api->store->{$pageid}=$seq;
next;
}
if(exists($tok->{'redirect'})){
$api->warnlog("$title is a redirect, skipping.\n");
$api->store->{$pageid}=$seq;
next;
}
 
$api->warnlog("Checking $title...\n");
 
my $intxt=exists($tok->{'revisions'}[0]{'*'})?$tok->{'revisions'}[0]{'*'}:'';
Line 234:
my $cat=$iter->iterval;
my $summary="Assessing for WikiProject California per $req $errto";
$api->warnlog("$summary in $title\n");
my $r=$api->edit($tok, $outtxt, $summary, 1, 1);
if($r->{'code'} ne 'success'){
Line 241:
}
} else {
$api->warnlog("Nothing to do in $title\n");
}