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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: AnomieBOT::API: * Change connectToReplica() for Tool Forge changes. BrokenRedirectDeleter: * Stop using a temporary table, since the new Tool Forge DBs don't support it anymore.
AnomieBOT (talk | contribs)
Updating published sources: DatedCategoryDeleterTest: * There doesn't seem to be much need for this still. Turning it back off.
 
(2 intermediate revisions by the same user not shown)
Line 1:
{{ombox|type=notice|text= Per [[WP:BOT#Approval]], any bot or automated editing process that only affects only the operators' user and talk pages (or subpages thereof), and which are not otherwise disruptive, may be run without prior approval.}}
{{ombox|type=notice|text= As of 2019-02-10, there doesn't seem to be any need for this.}}
<syntaxhighlight lang="perl">
package tasks::DatedCategoryDeleterTest;
Line 10 ⟶ 11:
Task: DatedCategoryDeleterTest
BRFA: N/A
Status: InOn trialhold
Created: 2017-01-31
Exclusion: false
Line 46 ⟶ 47:
and which are not otherwise disruptive, may be run without prior
approval.
 
=for info
As of 2019-02-10, there doesn't seem to be any need for this.
 
=cut
 
sub approved {
return -500;
}
 
Line 72 ⟶ 76:
SELECT page_namespace, page_title
FROM page JOIN categorylinks AS c1 ON(c1.cl_from=page_id) JOIN categorylinks AS c2 ON(c2.cl_from=page_id)
WHERE c1.cl_to = 'Candidates_for_uncontroversial_speedy_deletion' AND c2.cl_to = 'Monthly_clean_up_category_counterMonthly_clean-up_category_counter'
}, { Slice => {} } ) };
};
Line 118 ⟶ 122:
}
 
my $txt = $tok->{'revisions'}[0]{'slots'}{'main'}{'*'} // '';
unless ( $txt =~ /\s*\{\{Monthly clean[ -]up category(?:\s*\|[^\}]*)?\}\}\s*$/ ) {
$api->log( "Skipping [[Category:$title]], content isn't as expected" );
next;
Line 137 ⟶ 141:
next;
}
my $txt = $tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
$txt=~s/\s*$/\n/s;
my $time = strftime( '%Y-%m-%d %H:%M:%S', gmtime );