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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Supplemental BRFA to update old redirects as needed.
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Supplemental BRFA approved!
Line 1:
{{ombox|type=notice|text= Approved 2016-03-08<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 74]]}}
{{ombox|type=notice|text= Supplemental BFRA approval requestedapproved 2020-06-1119<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 80]]}}
<syntaxhighlight lang="perl">
package tasks::EnDashRedirectCreator;
Line 13:
Status: Approved 2016-03-08
+BRFA: Wikipedia:Bots/Requests for approval/AnomieBOT 80
+Status: BRFAApproved 2020-06-19
Created: 2016-03-03
 
Create redirects for articles with titles containing en-dashes from the
corresponding title with ASCII hyphens. Update these redirects later as
targets change.
 
=end metadata
Line 31 ⟶ 32:
use vars qw/@ISA/;
@ISA=qw/AnomieBOT::Task/;
 
my $brfa80 = 0;
 
my @skipNs = (
Line 84 ⟶ 83:
 
=for info
Supplemental BFRA approval requestedapproved 2020-06-1119<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 80]]
 
=cut
Line 147 ⟶ 146:
AND (
p2.page_id IS NULL
} . ( $brfa80 ? qq{
OR (
r2.rd_namespace != COALESCE( r1.rd_namespace, p1.page_namespace )
Line 153 ⟶ 151:
OR r2.rd_fragment != r1.rd_fragment
) AND EXISTS( SELECT 1 FROM revision WHERE rev_page = p2.page_id AND rev_actor IN ($actorIds) AND rev_parent_id = 0 )
} : "" ) . qq{
)
$cont
Line 239 ⟶ 236:
}
if ( !exists( $tok->{'missing'} ) ) {
if ( !$brfa80 ) {
$api->log("$redir already exists, skipping");
next;
}
my $res = $api->query(
titles => $redir,