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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: TagDater: * Process Category:Wikipedia categories sorted by month too. DatedCategoryCreator: * Use {{tl|Monthly maintenance category}} instead of {{tl|Monthly clean-up category}} where appropriate.
AnomieBOT (talk | contribs)
Updating published sources: DatedCategoryCreator: * Use correct key from allcategories response.
 
(3 intermediate revisions by the same user not shown)
Line 56:
'Articles containing potentially dated statements' => 31622400,
'Articles that include images for deletion' => 8*86400,
'Clean-up categories' => 31622400,
);
 
Line 155 ⟶ 156:
return $res if $res;
}
}
 
# Part 3: Look for missing dated categories beginning with "Clean-up categories from".
$iter = $api->iterator(
list => 'allcategories',
acprefix => 'Clean-up categories from ',
acprop => 'size|hidden',
aclimit => 'max',
formatversion => 2,
);
while ( my $c = $iter->next ) {
if ( ! $c->{'_ok_'} ) {
$api->warn( "Could not retrieve category list from iterator: " . $c->{'error'} . "\n" );
return 60;
}
next unless $c->{'category'} =~ / $monthre \d{4}$/;
next if $c->{'hidden'} || $c->{'size'} <= 0;
next if exists( $did{'Category:' . $c->{'category'}} );
$did{'Category:' . $c->{'category'}}=1;
$res = $self->make_dated_cat( $api, 'Category:' . $c->{'category'}, 'non-empty month' );
return $res if $res;
}
 
Line 193 ⟶ 215:
return 0 if $y>$t[5]+1900;
return 0 if($y==$t[5]+1900 && $monthnum{$m}>$t[4]+1);
return 0 if(!exists($oldcats{$parent}) && $y<20042010);
 
# Check whether the parent cat actually exists and is a subcat of the meta