weatherstats |
Subversion Repositories: |
Rev 1 | Rev 2 | |
---|---|---|
Line 141... | Line 141... | |
|
| |
sub create_graphs_for { |
sub create_graphs_for { | |
my %hasharray = %{$_[0]}; |
my %hasharray = %{$_[0]}; | |
my $wname = $_[1]; |
my $wname = $_[1]; | |
my %gtimes = ( |
my %gtimes = ( | |
"1h" => 3600, | ||
"6h" => 21600, | ||
"24h" => 86400, |
"24h" => 86400, | |
"7d" => 604800, | ||
"30d" => 2592000, |
"30d" => 2592000, | |
"1y" => 31536000, |
"1y" => 31536000, | |
"5y" => 157680000 |
"5y" => 157680000 | |
); |
); | |
my @color = ( "#dc0000", "#dc00dc", "#5800dc", "#009bdc", "#00dc87" ); |
my @color = ( "#dc0000", "#dc00dc", "#5800dc", "#009bdc", "#00dc87" ); | |
Line 321... | Line 324... | |
sub print_page { |
sub print_page { | |
my $page = $_[0]; |
my $page = $_[0]; | |
open ( PAGE, ">$wwwdir".$page."\.html") || die "ERROR: WeatherStats: Could not create page $wwwdir $rrdbn"; |
open ( PAGE, ">$wwwdir".$page."\.html") || die "ERROR: WeatherStats: Could not create page $wwwdir $rrdbn"; | |
print PAGE "<html>\n<head><title>Weather statistic from TOPCOM 265 NE</title></head>\n<body>\n"; |
print PAGE "<html>\n<head><title>Weather statistic from TOPCOM 265 NE</title></head>\n<body>\n"; | |
print PAGE "<h1>".ucfirst($page)."</h1>\n"; |
print PAGE "<h1>".ucfirst($page)."</h1>\n"; | |
print PAGE "<img src=\"".$page."_1h.gif\"/><br />\n"; | ||
print PAGE "<img src=\"".$page."_6h.gif\"/><br />\n"; | ||
print PAGE "<img src=\"".$page."_24h.gif\"/><br />\n"; |
print PAGE "<img src=\"".$page."_24h.gif\"/><br />\n"; | |
print PAGE "<img src=\"".$page."_7d.gif\"/><br />\n"; | ||
print PAGE "<img src=\"".$page."_30d.gif\"/><br />\n"; |
print PAGE "<img src=\"".$page."_30d.gif\"/><br />\n"; | |
print PAGE "<img src=\"".$page."_1y.gif\"/><br />\n"; |
print PAGE "<img src=\"".$page."_1y.gif\"/><br />\n"; | |
print PAGE "<img src=\"".$page."_5y.gif\"/><br />\n"; |
print PAGE "<img src=\"".$page."_5y.gif\"/><br />\n"; | |
print PAGE "</body></html>"; |
print PAGE "</body></html>"; | |
close PAGE |
close PAGE | |
Line 356... | Line 362... | |
&print_page($wtype); |
&print_page($wtype); | |
|
| |
$wtype = "humidity"; |
$wtype = "humidity"; | |
&print_body_begin($wtype); |
&print_body_begin($wtype); | |
foreach $atribute (keys %humidity) { |
foreach $atribute (keys %humidity) { | |
&print_body_line($wtype, $atribute, ${$humidity{$atribute}}[0], ${$humidity{$atribute}}[1], ${$humidity{$atribute}}[2]); |
&print_body_line($wtype, $atribute, ${$humidity{$atribute}}[0], ${$humidity{$atribute}}[1], "%"); | |
} |
} | |
print INDEX "</div>\n"; |
print INDEX "</div>\n"; | |
&print_page($wtype); |
&print_page($wtype); | |
|
| |
$wtype = "wind"; |
$wtype = "wind"; |