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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: General: * Update for the addition of 'rvslots'. DatedCategoryDeleterTest: * Disable. It's clear that task won't be needed. BrokenRedirectDeleter: * Handle pages with newlines before the <code>#REDIRECT</code>.
AnomieBOT (talk | contribs)
Updating published sources: TFATitleSubpageCreator: * Read the page from {{tl|TFAFULL}} instead of trying to find the right link in the wikitext.
Line 48:
my $res;
 
$api->task('TFATitleSubpageCreator', 0, 10, qw/d::Talk d::Templates/);
 
my $broken = 0;
Line 79:
my $template="Template:TFA title/$date";
 
unless(my $link = undef;
$_api->{'revisions'}[0]{'slots'}{'main'}{'*'}=~/'''\s*\[\[\s*process_templates([^|\]]+?)\s*(?:\|[^]]+)?\]\][a-z]*\s*'''/ || $_->{'revisions'}[0]{'slots'}{'main'}{'*'}=~m!<b>\s*\[\[\s*([^|\]]+?)\s*(?:\|[^]]+)?\]\]\s*</b>!, ||sub {
my $linkname =$1 shift;
$_->{'revisions'}[0]{'slots'}{'main'}{'*'}=~/\[\[\s*([^|\]]+?)\s*\|\s*'''[^]]+'''\s*\]\]/ || $_->{'revisions'}[0]{'slots'}{'main'}{'*'}=~m!\[\[\s*([^|\]]+?)\s*\|\s*<b>[^]]+</b>\s*\]\]!
){ my $params = shift;
$api->warn("Noreturn FAundef link inunless $title?\n")name eq 'TFAFULL';
for my $p ( $api->process_paramlist( @$params ) ) {
$link = $p->{'value'} if $p->{'name'} eq '1';
}
} );
if ( ! defined( $link ) ) {
$api->warn("No TFAFULL template in $title?\n");
warn $_->{'revisions'}[0]{'slots'}{'main'}{'*'};
next;
}
my $link=$1;
 
# Ask MediaWiki to canonicalize the title for us, because the actual