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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Userspace redirects probably aren't useful either.
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Don't create redirects that shadow pages on Commons.
Line 92:
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 50050
}, { Slice => {} } ) };
};
Line 156:
my ($origtarget, $target) = @$targets;
 
my $tok=$api->edittoken($redir, EditRedir => 1, imageinfo => { prop => '', limit => 1 });
if($tok->{'code'} eq 'shutoff'){
$api->warn("Task disabled: ".$tok->{'content'}."\n");
Line 165:
next;
}
if ( !exists( $tok->{'missing'} ) ) {
$api->log("$redir already exists, skipping");
next;
}
if ( exists( $tok->{'imagerepository'} ) && $tok->{'imagerepository'} ne '' ) {
$api->log("$redir is an existing image (repo=$tok->{imagerepository}), skipping");
next;
}