Content deleted Content added
Updating published sources: ArticleCreationGrapher: * Fix image filename. |
Updating published sources: ArticleCreationGrapher: * Add separate thumbnail size setting. * Fix "nextrun" logic. * Add the ability to label events at the top of the graph. |
||
Line 41:
graph => 'File:File-WikiProject Medicine - Dermatology task force - Articles created.svg',
size => [1000,600],
thumbsize => 800,
graph_cats => [],
x2ticsettings => 'rotate by 0 scale 0.4',
x2tics => '',
},
);
Line 77 ⟶ 80:
pages => {},
};
#XXX next if $pgdata->{'nextrun'} > time();▼
my @pp=();
if($nonet){
Line 85 ⟶ 87:
}
} else {
my $i=$api->iterator(
generator => 'categorymembers',
Line 181 ⟶ 184:
my $pid = open2(*R, *W, @gnuplot);
my ($w,$h)=@{$page->{'size'}};
my $range='["'.g_tt($pp[0]{'ts'}).'":"'.g_tt(time).'"]';
print W <<EOH ;
set terminal svg enhanced size $w $h font "DejaVu Sans"
Line 190 ⟶ 194:
set xdata time
set x2data time
set timefmt "%Y-%m"
set xtics nomirror out format "%b %Y"
set xrange $range
set x2range $range
EOH
print W <<EOH if $page->{x2tics} ne '';
set x2tics nomirror out $page->{x2ticsettings}
set x2tics ($page->{x2tics})
set grid x2tics
EOH
my @t=localtime $pp[0]{'ts'};
my $end=strftime('%Y-%m', localtime);
Line 244 ⟶ 258:
next;
}
my $txt="This is a compilation of article creation dates for $page->{for}\n\nThis page is generated by {{User|".$api->user."}} once a month. Last generated: ~~~~~\n\n[[$page->{graph}|".$page->{'
foreach my $p (@pp){
$txt.="|-\n| ".strftime('%F, %T', gmtime $p->{'ts'})." || [[:".$p->{'title'}."]] || ".($p->{'redir'}?'Redirect':'Article')."\n";
Line 309 ⟶ 323:
sub g_tt {
my @t=localtime shift;
return strftime('%Y-%m
}
Line 330 ⟶ 344:
if($dt ne $xx && $a!=$aa){
my @t=split(/-/,$dt);
my $dt2=strftime('%Y-%m
print $fh "$dt2 $aa\n" if(defined($pv) && $pv ne $dt2);
print $fh "$dt $a\n";
|