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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Approved!
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Skip namespaces where normal redirects aren't used or aren't likely to be useful.
Line 27:
use vars qw/@ISA/;
@ISA=qw/AnomieBOT::Task/;
 
my @skipNs = (
14, 15, # Category, doesn't use normal redirects
118, 119, # Draft, probably not useful
446, 447, # Education Program, probably not useful
828, 829, # Module, doesn't use normal redirects
2300, 2301, # Gadget, probably doesn't use normal redirects
2302, 2303, # Gadget definition, probably doesn't use normal redirects
2600, 2601, # Topic, probably doesn't use normal redirects
);
 
sub new {
Line 64 ⟶ 74:
 
my $cont = $self->{'dbcontinue'} // '';
my $skipNs = join( ',', @skipNs );
 
# Spend a max of 5 minutes on this task before restarting
Line 78 ⟶ 89:
FROM page as p1
LEFT JOIN page AS p2 ON ( p1.page_namespace = p2.page_namespace AND REPLACE( p1.page_title, '–', '-' ) = p2.page_title )
WHERE p1.page_title LIKE '%–%' AND p2.page_id IS NULL AND p1.page_namespace NOT IN ($skipNs) $cont
ORDER BY p1.page_namespace, p1.page_title
LIMIT 500