Content deleted Content added
Updating published sources: AccidentalLangLinkFixer: * Special case "<nowiki>[[Category:]]</nowiki>", which doesn't create a link either way. |
Updating published sources: CFDClerk: * Someone made a module to parse Wikipedia:Categories for discussion/Old unclosed discussions and produce Wikipedia:Categories for discussion/Awaiting closure, so stop editing the latter. AccidentalLangLinkFixer: * Fix category name in the task description. |
||
(5 intermediate revisions by the same user not shown) | |||
Line 14:
Periodically checks pages in [[:Category:Pages automatically checked for
running text, and adds the necessary ":" to make them wikilinks instead.
Line 31:
@ISA=qw/AnomieBOT::Task/;
my @categories = (
'Category:Pages automatically checked for incorrect links',
);
my $frequency=600; # minutes
Line 51 ⟶ 54:
sub approved {
return
}
Line 73 ⟶ 76:
$self->{'iter'}=$api->iterator(
generator => 'categorymembers',
gcmtitle =>
gcmlimit =>
prop => 'langlinks|categories',
lllimit => 'max',
Line 82 ⟶ 85:
}
while(my $pg=$self->{'iter'}->next){
my $category = $self->{'iter'}->iterval;
if(!$pg->{'_ok_'}){
$api->warn("Failed to retrieve page list for $category: ".$pg->{'error'}."\n");
Line 114 ⟶ 118:
# Fix any bad links
my $intxt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
my ($outtxt,$nowiki)=$api->strip_regex(qr/^(?:\s|<!--.*?-->|<\/?(?:noinclude|includeonly|onlyinclude)>)*\[\[\s*(?:$llre|$clre)\s*:[^]]*\]\](?:\s|<!--.*?-->|<\/?(?:noinclude|includeonly|onlyinclude)>)*$/m, $intxt);
($outtxt,$nowiki)=$api->strip_regex(qr/\[\[\s*(?:$clre)\s*:\s*(?:\|[^]]*)?\]\]/, $outtxt, $nowiki);
($outtxt,$nowiki)=$api->strip_nowiki($outtxt,$nowiki);
|