Content deleted Content added
Updating published sources: WikiProjectWorker: * WikiProject NATO run seems to be complete AnomieBOT::API * Slightly better error handling when MediaWiki:Missing-article occurs when etching tokens. |
Updating published sources: WikiProjectWorker: * Start run for WikiProject California d::WikiProjectTagging: * WPBmin/WPBmax fix for comments in the value. |
||
Line 33:
### Request link, for edit summary.
my $req="[[User:AnomieBOT/req/WikiProject
### Increment this number every time a new run is started, so we don't have to
### mess around with deleting previous runs' database entries.
my $seq=
### How to find the pages?
Line 44:
list => 'categorymembers',
cmtitle => [
'Category:
],
cmnamespace => '0|1',
Line 78 ⟶ 57:
$t="Talk:$t" if $_[0]->{'ns'} == 0;
return $t;
}
### How to copy other projects' assessments
sub copy_class {
my ($api, $intxt) = @_;
my ($class) = $api->WPBmax($intxt);
return $class;
}
sub copy_importance {
return '';
}
# Banner configurations.
my %banner_cfgs=(
'WikiProject
meta => 0,
stubauto => 'auto',
canonicalize => 'WikiProject
},
);
Line 105 ⟶ 95:
sub approved {
return
}
Line 179 ⟶ 169:
my @params=();
my $assess = undef
my
if(ref($class)
$api->warn("Processing $
next;
}
if($class
$assess=$api->WPBassess($title);
if(ref($assess) eq 'HASH'){
Line 198 ⟶ 189:
} else {
push @params, "class=$class";
my $imp = copy_importance($api, $intxt);
if(ref($imp) eq 'HASH'){
$api->warn("Processing $title failed: ".$imp->{'error'}."\n");
next;
}
push @params, "importance=$imp" if $imp eq '';
}
$outtxt=$api->WPBadd($outtxt, $assess, sub {
my $oname=shift;
my $params=shift;
shift; # wikitext
my $new=shift;
return undef if $new;
foreach my $p (@params){
next unless $p=~/^(.+?)=(.*)$/;
my ($k,$v)=($1,$2);
unless(grep(/^\s*\Q$k\E\s*=\s*\S/, @$params)){
push @$params, "$k=$v" unless(grep(s/^(\s*\Q$k\E\s*=)(\s*)$/$1$v$2/s, @$params));
}
}
return "{{$oname}}" unless @$params;
return "{{$oname|".join("|", @$params)."}}";
}, 'WikiProject California', @params);
if(ref($outtxt) eq 'HASH'){
$api->warn("Processing $title failed: ".$outtxt->{'error'}."\n");
Line 219 ⟶ 233:
my $cat=$iter->iterval;
my $summary="Assessing for WikiProject
$api->warn("$summary in $title\n");
my $r=$api->edit($tok, $outtxt, $summary, 1, 1);
|