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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: ReplaceExternalLinks: * Forgot to skip <nowiki> and the like, not that that's likely to be encountered.
AnomieBOT (talk | contribs)
Updating published sources: SourceUploader: * Sort directory pages by last modified date. * Use <nowiki><syntaxhighlight></nowiki> instead of <nowiki><source></nowiki>. d::NoWiki: * Add support for <nowiki><syntaxhighlight></nowiki>. General: * Vario
 
(10 intermediate revisions by the same user not shown)
Line 1:
{{ombox|type=content|style=border:1px solid #b22222|image=[[Image:Ambox warning pn.svg|40px]]|text= Due to breaking changes in AnomieBOT::API, this task will probably not run anymore. If you really must run it, try getting a version from before 2009-03-23.}}
{{ombox|type=notice|text= ApprovalApproved requested2008-11-11, completed 2008-11-0812<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 9]]}}
<sourcesyntaxhighlight lang="perl">
package tasks::ReplaceExternalLinks;
 
=pod
 
=for warning
Due to breaking changes in AnomieBOT::API, this task will probably not run
anymore. If you really must run it, try getting a version from before
2009-03-23.
 
=begin metadata
 
Bot: AnomieBOT
Task: ReplaceExternalLinks
BRFA: Wikipedia:Bots/Requests for approval/AnomieBOT 9
Status: BRFA
Status: Completed 2008-11-12
Rate: Max 6 edits/minute
Created: 2008-11-08
 
Replace links to the domains "w*.allmusic.com with just "allmusic.com", as those other domains no longer function.
 
=end metadata
Line 35 ⟶ 42:
 
=for info
ApprovalApproved requested2008-11-11, completed 2008-11-0812<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 9]]
 
=cut
 
sub approved {
return 0-1;
}
 
Line 49 ⟶ 56:
$api->task('ReplaceExternalLinks');
$api->read_throttle(0);
$api->edit_throttle(0.10);
 
# Spend a max of 5 minutes on this task before restarting
Line 81 ⟶ 88:
my @repl=(
[ qr{\bhttp://(?:w[cm][0-9][0-9]|wc\)\()\.allmusic\.com(?=[][/<>"\x00-\x20\x7F]|$)}i, 'http://allmusic.com', 'updating broken allmusic.com links' ],
[ qr{\bhttp://:www\.allmusic\.com(?=[][/<>"\x00-\x20\x7F]|$)}i, 'http://allmusic.com', 'changing www.allmusic.com to allmusic.com' ],
);
my $req=" per [[WP:BOTREQ#Allmusic links|request]]";
Line 119 ⟶ 126:
 
# Ok, check the page
my $tok=$api->edittoken($title, EditRedir => 1);
if($tok->{'code'} eq 'shutoff'){
$self->warn("Task disabled: ".$tok->{'content'}."\n");
Line 180 ⟶ 187:
1;
 
</syntaxhighlight>
</source>