Content deleted Content added
Updating published sources: DatedCategoryCreator: * Pointless template rename. DatedCategoryDeleterTest: * Apparently the test was screwed up by a similar category rename. Sigh. Re-enable the test. |
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. |
||
Line 178:
# clean-up category}}.
my $parent=$title;
my $
$parent=~s/^Category://;
$parent=~s/($monthre) (\d{4})$//;
Line 184:
if(exists($rcatmap{$parent})){
$parent=$rcatmap{$parent};
$
} else {
return 0 unless $parent=~s/ from $//;
Line 194:
return 0 if($y==$t[5]+1900 && $monthnum{$m}>$t[4]+1);
return 0 if(!exists($oldcats{$parent}) && $y<2004);
# Check whether the parent cat actually exists and is a subcat of the meta
Line 200 ⟶ 199:
my $res=$api->query(
titles => "Category:$parent",
prop => 'categories|templates',
clcategories => 'Category:Wikipedia maintenance categories sorted by month|Category:Wikipedia categories sorted by month',
tltemplates => 'Template:Parent monthly maintenance category',
);
if($res->{'code'} ne 'success'){
Line 212:
return 0;
}
my ($type, $txt);
if(grep $_->{'title'} eq 'Category:Wikipedia maintenance categories sorted by month', @{$res->{'categories'}}){
if ( grep $
$type='maintenance category';
$txt="{{Monthly maintenance category$tmplparams}}";
} else {
$type='clean-up category';
$txt="{{Monthly clean-up category$tmplparams}}";
}
} elsif(grep $_->{'title'} eq 'Category:Wikipedia categories sorted by month', @{$res->{'categories'}}){
$type='category';
$txt="{{Monthly maintenance category$tmplparams}}";
} else {
$api->warn("Did not create category $title, because parent category $parent is not in Category:Wikipedia maintenance categories sorted by month or Category:Wikipedia categories sorted by month");
|