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

Content deleted Content added
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
AnomieBOT (talk | contribs)
Updating published sources: d::Redirects: * Redo redirects_to and redirects_to_resolved to use the new prop=redirects. Much faster and more accurate, but let's hope I didn't introduce any bugs.
Line 66:
 
# Get a list of templates redirecting to our targets
my %templates=$api->redirects_to_resolved(map "Template:$_", @templates);
foreach my $template if(@exists($templates{''})){
$api->warn("Failed to get redirects to target templates: ".$templates{''}{'error'}."\n");
$templates{"Template:$template"}=1;
$res=$api->query([],return 60;
list => 'backlinks',
bltitle => "Template:$template",
blfilterredir => 'redirects',
bllimit => 'max',
);
$templates{$_->{'title'}}=1 foreach (@{$res->{'query'}{'backlinks'}});
}