#!/usr/bin/perl use strict; use warnings; use lib '.'; use UCW::CGI; my $graph; UCW::CGI::parse_args({ 'g' => { 'var' => \$graph, 'default' => 'temp-12h' }, }); print < Weather in the Burrow

Weather in the Burrow

AMEN sub links(@) { my $prefix = shift @_; my $out = ""; for my $x (@_) { my $y = $prefix . $x; if ($graph eq $y) { $out .= " $x"; } else { $out .= " $x"; } } return $out; } print "

Temperature:", links("temp-", "quick", "12h", "48h", "month"), "\n"; print "

Humidity:", links("rh-", "12h", "48h", "month"), "\n"; print "

Power:", links("power-", "2h", "2h-detail", "day", "day-detail", "48h", "48h-detail", "week", "month"), "\n"; if ($graph =~ /^power-/) { $graph = "http://micac.burrow.ucw.cz/cgi-bin/$graph"; } print "

\n";