-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathmkdash.pl
More file actions
executable file
·35 lines (30 loc) · 894 Bytes
/
mkdash.pl
File metadata and controls
executable file
·35 lines (30 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env perl
my $dir=$ARGV[0];
# here's the list of newly made graphs
open(S, "<$dir/all.txt");
while(<S>) {
chomp;
if($_ =~ /^#/) {
# comment
next;
}
elsif($_ =~ /^(.*) = (.*)/) {
$svg{$1} = $2;
}
}
close(S);
my $count = 0;
for my $s (sort {lc($a) cmp lc($b)} keys %svg) {
my $alt = $s;
$alt =~ tr/ /-/; # space2dash
printf "<div class=\"gr\" id=\"%s\"><center>%s</center><p><a title=\"%s\" href=\"dashboard1.html#%s\"><img alt=\"%s\" class=\"dash\" src=\"$dir/%s\"></a></div>\n",
$alt, $s, $s, $alt, $s, $svg{$s};
$count++;
}
sub now {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
gmtime(time);
return sprintf "%04d-%02d-%02d %02d:%02d:%02d UTC",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec;
}
print "<br style=\"clear: both;\">$count images created at ".now()."\n";