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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: PERTableUpdater: * Handle template-protection, currently lumped in with CAT:EP.
AnomieBOT (talk | contribs)
Updating published sources: PERTableUpdater: * Support MediaWiki:Titlewhitelist.
Line 83:
# that mechanism
my %tb=();
my %@sources=(
[ 1, 'TitleGlobal title blacklist' =>, 'MediaWikimeta:TitleblacklistTitle blacklist' ],
[ 2, 'Global titleTitle blacklist' =>, 'metaMediaWiki:TitleTitleblacklist' blacklist'],
[ 3, undef, 'MediaWiki:Titlewhitelist' ],
);
while(for my ($k,$page)=eachsource %(@sources) {
my ($i, $name, $page) = @$source;
my $tb=$api->rawpage($page);
if($tb->{'code'} ne 'success'){
Line 115 ⟶ 117:
# Let's just hope no one ever uses {{int:}} here...
 
$tb{$re}={
$tb{$re}={ source=>"[[$page|$k]]", line=>$line, opts=>\%opts } unless(($opts{'moveonly'}//0) || ($opts{'newaccountonly'}//0));
i => $i,
source => $name ? "[[$page|$name]]" : undef,
line => $line,
opts => \%opts
$tb{$re}={ source=>"[[$page|$k]]", line=>$line, opts=>\%opts } unless(($opts{'moveonly'}//0) || ($opts{'newaccountonly'}//0));
}
}
Line 233 ⟶ 240:
$protscore=0x40;
}
 
my $tb = undef;
while(my ($re,$data)=each %tb){
next unlessif $t=~/^(?:tb && $re)tb->{'i'} >= $/sidata->{'i'};
next unless(exists($p->{'missing'}) || ($data->{'opts'}{'noedit'}//0));
mynext unless $sct=exists~/^($data->{'opts'}{'autoconfirmed'})?0x12:0x22$re)$/si;
$tb = $data;
}
if ( $tb && $tb->{'source'} ) {
my $sc=exists($tb->{'opts'}{'autoconfirmed'})?0x12:0x22;
next if $sc<$protscore;
$pd->{'prottype'}=$datatb->{'source'};
my $line=$datatb->{'line'};
$pd->{'reason'}=qq(Matching line: <syntaxhighlight lang="text" enclose="none">$line</syntax).qq(highlight>);
$protscore=$sc;