Content deleted Content added
Updating published sources: ArticleCreationGrapher: * Deny Svenbot from image page. |
Updating published sources: ArticleCreationGrapher: * Adjust storage so it's easier to force a run when needed. * Add {{tl|esoteric file}}. Meh. |
||
Line 78:
foreach my $page (@pages){
return 0 if $api->halting;
my $pgdata=$api->store->{$page->{'page'}} // {▼
#
if ( exists( $api->store->{$page->{'page'}}
};▼
$api->store->{'epoch:'.$page->{'page'}} = $pgdata->{'epoch'} // 0;
$api->store->{'nextrun:'.$page->{'page'}} = $pgdata->{'nextrun'};
$api->store->{'pg:'.$page->{'page'}} = $pgdata->{'pages'};
delete( $api->store->{$page->{'page'}} );
my $nextrun = $api->store->{'nextrun:'.$page->{'page'}} // 0;
my $pages = $api->store->{'pg:'.$page->{'page'}} // {};
my @pp=();
if($nonet){
foreach my $v (values %
next unless ref($v) eq 'HASH';
push @pp, { redir=>$v->{'r'}, ts=>$v->{'t'}, title=>$v->{'tt'} };
}
} else {
next if($
my $i=$api->iterator(
generator => 'categorymembers',
Line 111 ⟶ 119:
foreach my $p (@pageids) {
return 0 if $api->halting;
if(exists($
push @px, $p;
next;
Line 117 ⟶ 125:
if($ct++>=100){
# periodic save
$api->store->{'pg:'.$page->{'page'}}=$
$ct=0;
}
Line 128 ⟶ 136:
);
if($res->{'code'} eq 'shutoff'){
$api->store->{'pg:'.$page->{'page'}}=$
$api->warn("Task disabled: ".$res->{'content'}."\n");
return 300;
}
if($res->{'code'} ne 'success'){
$api->store->{'pg:'.$page->{'page'}}=$
$api->warn("Failed to get info for $p: ".$res->{'error'}."\n");
return 60;
Line 143 ⟶ 151:
next if $ts eq '';
$ts=$api->ISO2timestamp($ts);
$
t=>$ts,
r=>$is_redir,
Line 155 ⟶ 163:
return 0 if(time>$endtime);
}
$api->store->{'pg:'.$page->{'page'}}=$
if(@px){
my %q=(
Line 171 ⟶ 179:
}
my $p=$_->{'pageid'};
$
$
push @pp, {
title=>$_->{'title'},
redir=>$
ts=>$
};
}
$api->store->{'pg:'.$page->{'page'}}=$
}
}
Line 292 ⟶ 300:
}
my $comment="Updated graph";
my $txt="{{imbox|type=style|image=[[File:Ambox warning yellow.svg|50px]]|imageright=[[File:Crystal Clear action run.svg|50px]]|text=This image is automatically updated by a bot, {{User|".$api->user."}}. Any changes will be overwritten automatically.<center>'''Do not move this file to Wikimedia Commons.'''<br /><small>If for some reason you need to stop the bot, place {{tl|nobots}} on this page or post a message [[User:".$api->user."/shutoff/ArticleCreationGrapher|here]].</small></center>}}\n{{Information\n|description=Bot-generated graph of [[$page->{page}|$page->{for}]] article creation\n|source=Own work, created using [[Gnuplot]]\n|date=~~~~~\n|author={{User|".$api->operator."}} as the author of {{User|".$api->user."}}\n|permission={{PD-self|date=August 2010}}\n}}\n{{bots|deny=Fbot,Svenbot}}\n{{esoteric file}}\n\n[[Category:Wikipedia charts]]\n";
foreach my $c (@{$page->{'graph_cats'}}){
$txt.="[[Category:$c]]\n";
Line 307 ⟶ 315:
}
@t=gmtime;
$
$
$api->store->{'nextrun:'.$page->{'page'}}=timegm(0,0,0,1,$t[4]+1,$
if(!exists($tok->{'missing'})){
Line 327 ⟶ 335:
my $t=undef;
foreach my $page (@pages){
my $
$t=$
}
return $t-time();
|