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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: General: * Begin development of a new task: SandboxCleaner, loosely based on User:SoxBot IV/Source. * And put a hold on it, since SoxBot IV is back up. Oh well.
 
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>.
 
(12 intermediate revisions by 4 users not shown)
Line 1:
{{ombox|type=content|text= Credit to [[User:SoxBot IV/Source|SoxBot IV]] for a bit of inspiration on the code.}}
{{ombox|type=customcontent|style=border:1px solid #b22222|image=[[Image:Ambox warning pn.svg|40px]]|text= Not approved.}}
<sourcesyntaxhighlight lang="perl">
package tasks::SandboxCleaner;
 
Line 8:
=begin metadata
 
Bot: AnomieBOT
Task: SandboxCleaner
BRFA: None
Status: In development - onOn hold
Rate: Max 1 edit per hour per sandbox
Created: 2008-08-30
 
Clears a sandbox page to predefined content once every 12 hours (at or shortly
Line 25 ⟶ 26:
=cut
 
use utf8;
use strict;
 
Line 95 ⟶ 97:
 
sub approved {
return 10;
}
 
Line 183 ⟶ 185:
next;
}
my $intxt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
 
# Generate new page content
Line 229 ⟶ 231:
1;
 
</syntaxhighlight>
</source>