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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: PERTableUpdater: * Since Module pages are so much like Templates, color them green too.
AnomieBOT (talk | contribs)
Updating published sources: PERTableUpdater: * Make use of the new hidden "urn:" links to detect edit requests for pages other than the subjectpage of the talk page containing the template.
Line 119:
 
my @data=(
[[10,828],'PER','Wikipedia protected edit requests','protected','editprotected','x-wp-editprotected',[qw/red red red yellow clear yellow yellow/]],
[[10,828],'SPER','Wikipedia semi-protected edit requests','semi-protected','editsemiprotected','x-wp-editsemiprotected',[qw/red clear yellow red red red red/]],
[[0],'EDITREQ','Requested edits','COI','requestedit','x-wp-requestedit',[qw/clear yellow yellow red red red red/]],
);
my $starttime=time;
for my $data (@data){
my ($greenns,$tag,$cat,$type,$tgt,$urn,$colors)=@$data;
my $iter=$api->iterator(
generator => 'categorymembers',
gcmtitle => "Category:$cat",
gcmlimit => 'max',
prop => 'info|extlinks',
ns elprotocol => $p->{'nsurn'}&~1,
ellimit title => $t'max',
);
my %oldpages=%{$api->store->{"$tag pages"}//{}};
Line 140 ⟶ 142:
}
next unless $p->{'ns'}&1;
my $t@pages =$p-> map {'title'};
if return () unless $p_->{'ns*'}==1~/^urn:$urn:(.+){$/i;
my $turl =~s/^Talk:// $1;
} else { $url=~s/\+/ /g;
$turl =~s/^ uri_unescape([^:]+) talk:/$1:/url );
}utf8::decode( $url );
$url;
delete} $pages@{$t}p->{'colorextlinks'}//[]};
delete $unless(@pages){$t}{'reason'};
my talk $t=> $p->{'title'},;
if($p->{'ns'}==1){
$t=~s/^Talk://;
} else {
$t=~s/^([^:]+) talk:/$1:/;
}
delete $ push @pages{, $t}{'prottype'};
}
for my $t (@pages) {
$pages{$t}=($oldpages{$t} // {
touched ns => ISO2timestamp($p->{'touchedns'})&~1,
title => $t,
talk => $p->{'title'},
touched => ISO2timestamp($p->{'touched'}),
});
delete $pages{$t}{'logtitlecolor'};
delete $pages{$t}{'prottype'};
delete $pages{$t}{'reason'};
delete $pages{$t}{'logtitle'};
}
$pages{$t}=($oldpages{$t} // {
ns => $p->{'ns'}&~1,
title => $t,
talk => $p->{'title'},
touched => ISO2timestamp($p->{'touched'}),
});
delete $pages{$t}{'color'};
delete $pages{$t}{'prottype'};
delete $pages{$t}{'reason'};
delete $pages{$t}{'logtitle'};
}
$api->store->{"$tag pages"}=\%pages;