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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: TFATitleSubpageCreator: * Whine on the bot's talk page if today's or tomorrow's subpage is empty.
AnomieBOT (talk | contribs)
Updating published sources: TFATitleSubpageCreator: * Retry sooner if there were errors.
Line 50:
$api->task('TFATitleSubpageCreator', 0, 10, qw/d::Talk/);
 
my $broken = 0;
my @titles=();
my @t=gmtime();
Line 92 ⟶ 93:
if($res->{'code'} ne 'success'){
$api->warn("Failed to get canonical name for $link: ".$res->{'error'}."\n");
$broken = 1;
next;
}
Line 104 ⟶ 106:
if($tok->{'code'} ne 'success'){
$api->warn("Failed to get edit token for $template: ".$tok->{'error'}."\n");
$broken = 1;
next;
}
Line 113 ⟶ 116:
if($r->{'code'} ne 'success'){
$api->warn("Write failed on $template: ".$r->{'error'}."\n");
$broken = 1;
next;
}
Line 142 ⟶ 146:
my $fa=$title; $fa=~s/^Template:TFA title\//Wikipedia:Today\x27s featured article\//;
$api->whine("Cannot find featured article in [[$fa]]", "Help! I can't find the featured article link in [[$fa]] in order to populate [[$title]]. Please correct the link or create the template manually.");
$broken = 1;
}
}
 
# Retry soon if there was a failure.
return 600 if $broken;
 
# Ok, done. Run once at 11pm (UTC) and again right at midnight, and