#!/opt/csg/bin/perl # # latestv -- page for latest oven images and temperatures. # # call as a cgi script # # Copyright (C) 1997 by J. M. Hill # Created at Steward Observatory for use by # the Large Binocular Telescope Project, 14JUN97 # $version = "16JUN97"; $picaname = "rlbt/videoa.gif"; $picbname = "rlbt/videob.gif"; $piccname = "rlbt/videoc.gif"; $picdname = "rlbt/videod.gif"; $picename = "rlbt/videoe.gif"; $infoname = "rlbt/temperature"; # strip \'s put in by server (apparently) $ARGV[0] =~ s/\\(.)/$1/g; # introduction print "Content-type: text/html\n\n"; print "
| \n";
print "Camera A \n"; print " | \n";
print "\n";
print "Camera B \n"; print " | \n";
print "\n";
print "Camera C \n"; print " | \n";
print "\n";
print "Camera D \n"; print " | \n";
print "\n";
print "Camera E \n"; print " | \n";
print "
\n";
if ( -e $infoname ) {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat($infoname);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($mtime);
$datet = $mon+1 . "/" . $mday . "/" . $year ;
$timet = $hour . ":" . $min . " MST" ;
open(SFILE,$infoname);
$line = \n";
}
print "For the duration of annealing these images will only update a few times per day. \n";
print "\n \n";
print " To the previous page \n";
#######################################################################################
sub freshness {
# subroutine to get file stats and format them into a string
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat(@_);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($mtime);
$sizea = int($size / 1000) . " kB";
$datea = $mon+1 . "/" . $mday . "/" . $year . "
\n";
print "\nThis page was generated automatically by J. M. Hill's \"latestv.cgi\" script, version $version.
";
$timea = $hour . ":" . $min . " MST
" ;
$freshness = $datea . $timea . $sizea ;
}