Content deleted Content added
Updating published sources: WikiProjectWorker: * Done! |
Updating published sources: WikiProjectWorker: * Start priority maintenance for WPBiography d::WikiProjectTagging: * Update WPBiography living and activepol regexes. |
||
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?
my @cats=(
'Category:Biography articles with more than one work group needing priority parameter replacement',
);
my @iterators=(
{
generator => '
prop => 'templates',▼
tllimit => 'max',▼
},
);
Line 70 ⟶ 69:
# Banner configurations.
my $main_banner='
my @preprocess_templates=();
my %banner_cfgs=(
'
meta => 0,
importance => '',
blp => qr/(?:living|blpo)\s*=\s*+(?!(?i)no|n|0|$|¬)/,
activepol => qr/activepol\s*=\s*+(?!(?i)no|n|0|$|¬)/,
},
);
my %wg=(
'a&e-work-group' => 'a&e-priority',
'filmbio-work-group' => 'filmbio-priority',
'musician-work-group' => 'musician-priority',
'military-work-group' => 'military-priority',
'peerage-work-group' => 'peerage-priority',
'politician-work-group' => 'politician-priority',
'royalty-work-group' => 'royalty-priority',
's&a-work-group' => 's&a-priority',
'sport-work-group' => 'sport-priority',
);
Line 96 ⟶ 110:
sub approved {
return
}
Line 192 ⟶ 206:
}
}
} else {
push @params, "class=$class";
Line 247 ⟶ 260:
$page=$api->query(
titles => $pg,
prop => 'templates',▼
tllimit => 'max',▼
);
if($page->{'code'} eq 'shutoff'){
Line 260 ⟶ 271:
$page=(values %{$page->{'query'}{'pages'}})[0];
}
push @params, 'UK=yes';▼
push @params, 'UK-importance=';▼
}▼
$outtxt=$api->WPBadd($outtxt, $assess, sub {
Line 280:
my $new=shift;
return undef if $new;
my $prio=undef;
foreach my $p (@$params){
$prio=$1 if $p=~/^\s*priority\s*=\s*(\S.*?)\s*$/;
▲ }
return $wikitext unless defined($prio);
foreach my $p (@$params){
next if $p=~/^\s*priority\s*=/;
if($p=~/^(\s*([^=]*?)\s*=\s*+(?!(?i)no|n|0|$|¬).*?)(\s*)$/ && exists($wg{$2})){
push @pp, $wg{$2}.'='.$prio.$3;
}
my $any=0;
Line 292 ⟶ 309:
}
}
#return $wikitext unless $any;
my $out="{{$oname";
Line 298 ⟶ 315:
$out.="}}";
return $wikitext if $out eq $wikitext;
push @summary, "updating {{$main_banner}} workgroup priority" unless @summary;
return $out;
}, $main_banner, @params);
|