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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: SourceUploader: * D'oh! Don't follow the redirect when creating those shutoff talk pages.
AnomieBOT (talk | contribs)
Updating published sources: SourceUploader: * Bypass redirects when redirecting shutoff talk pages to the bot's talk page.
Line 264:
}
 
$api->task('SourceUploader', 0, 10, ()qw/d::Redirects/);
 
my $src='User:'.$api->user.'/source';
Line 334:
$tpage=~s/^User:/User talk:/;
my $txt=$tpage;
$txt=~s!^(User talk:[^/]+)/.*!#REDIRECT [[$1]]\n\nThis page is unwatched. Please direct comments to [[$1]].!;
my $r={$api->resolve_redirects($txt)};
if(exists($r->{''})){
$api->warn("Error fetching redirects for $page: ".$r->{''}{'error'}."\n");
return 60;
}
$txt=$r->{$txt};
$txt="#REDIRECT [[$txt]]\n\nThis page is unwatched. Please direct comments to [[$txt]].";
$tok=$api->edittoken($tpage, EditRedir=>1, NoExclusion=>1);
if($tok->{'code'} eq 'shutoff'){