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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: PageCreator: * Approved!
AnomieBOT (talk | contribs)
Updating published sources: PageCreator: * Comment out "Hassnium", may be a typo. * Don't re-create pages if they have already been created once. * Don't follow redirects to create the pointed-to page.
Line 118:
'Seaborgium' => [ 258, 273 ],
'Bohrium' => [ 260, 275 ],
# 'Hassnium' => [ 263, 277 ],
'Meitnerium' => [ 265, 279 ],
'Darmstadtium' => [ 267, 281 ],
Line 162:
for(my $iso=$range->[0]; $iso<=$range->[1]; $iso++){
my $title="$element-$iso";
next if exists($api->store->{$title});
my $redir="Isotopes of ".lc($element)."#$element-$iso";
my $page=sprintf("#REDIRECT [[Isotopes of %s#%s-%d]]\n\n[[Category:Isotopes of %s|%s-%0*d]]", lc($element), $element, $iso, lc($element), $element, $l, $iso);
 
# Ok, check the page
my $tok=$api->edittoken($title, EditRedir => 1);
if($tok->{'code'} eq 'shutoff'){
$api->warn("Task disabled: ".$tok->{'content'}."\n");
Line 177 ⟶ 178:
if(!exists($tok->{'missing'})){
$api->log("$title already exists, skipping");
$api->store->{$title}=1;
next;
}
Line 188 ⟶ 190:
next;
}
$api->store->{$title}=1;
 
# If we've been at it long enough, let another task have a go.