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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: SourceUploader: * Sort directory pages by last modified date. * Use <nowiki><syntaxhighlight></nowiki> instead of <nowiki><source></nowiki>. d::NoWiki: * Add support for <nowiki><syntaxhighlight></nowiki>. General: * Vario
AnomieBOT (talk | contribs)
Updating published sources: General: * Update for the addition of 'rvslots'. DatedCategoryDeleterTest: * Disable. It's clear that task won't be needed. BrokenRedirectDeleter: * Handle pages with newlines before the <code>#REDIRECT</code>.
 
(One intermediate revision by the same user not shown)
Line 34:
generator => 'categorymembers',
gcmtitle => 'Category:Wikipedia redirects',
gcmlimit => 'max100',
prop => 'info',
},
Line 46:
my $api=shift;
my $tok=shift;
my $txt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
$txt=~s/\[\[\s*(?i:Category)\s*:\s*[wW]ikipedia redirects\s*(?:\|.*?)?\]\]\s*//;
return ($txt,"Removing [[Category:Wikipedia redirects]] as that category is not intended for actual redirects");
Line 111:
 
my ($txt,$log)=$def->{'edit'}($api,$tok);
next if(!defined($txt) || $txt eq $tok->{'revisions'}[0]{'slots'}{'main'}{'*'});
 
$api->log("Editing $title: $log");