Just for fun I wrote a Perl program to generate some html code to do a simple display of a series of flags sent to it by HCA as parameters. This program creates a file that contains the web page to be displayed. NcFTP is then used to transmit the file to the web server. You can see the resulting page at http://sundrysites.com/weather/ysst.htm.
use warnings;
use strict;
# use Time::Piece;
# major definitions
my $outfile = “ysst.htm”; #
my $outln = “”;
# my $date = Time::Piece->new->strftime(‘%m/%d/%Y’);
my $datestring = localtime();
use Getopt::Long; #pick up parms
my $ti = sprintf(“%.1f”,$ARGV[0]); #temp indoor
my $to = sprintf(“%.1f”,$ARGV[1]); #temp office
my $tg = sprintf(“%.1f”,$ARGV[2]); #temp garage
my $tb = sprintf(“%.1f”,$ARGV[3]); #temp basement
my $tn = sprintf(“%.1f”,$ARGV[4]); #temp noaa
my $rb = sprintf(“%.1f”,$ARGV[5]); #rel humid basemnt
my $rn = sprintf(“%.1f”,$ARGV[6]); #rel humid noaa
my $pr = sprintf(“%.0f”,$ARGV[7]); # sump pump run
# print $page, “\n”;
open OUTPUT, “> $outfile” or die “Output file open error: $!”;
$outln = ‘<HTML><HEAD>’;
print OUTPUT $outln;
$outln = ‘<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=windows-1252″>’;
print OUTPUT $outln;
$outln = ‘<LINK REL=STYLESHEET HREF=”ysst-ss.css” TYPE=”text/css”>’;
print OUTPUT $outln;
$outln = ‘<TITLE>YELLOW SPRINGS STATUS</TITLE>’;
print OUTPUT $outln;
$outln = ‘</HEAD><body style=”width:800px”>’;
print OUTPUT $outln;
$outln = “<center>YS Current Status as of: $datestring<br />”;
print OUTPUT $outln;
$outln = ‘<table BORDER CLASS=”boldtable”>’;
print OUTPUT $outln;
$outln = ‘<tr><td>TInd</td><td>TOff</td><td>TGar</td><td>TBas</td><td>TNoaa</td><td>HBas</td><td>HNoaa</td><td>SP#</td></tr>’;
print OUTPUT $outln;
$outln = “<tr><td>$ti</td><td>$to</td><td>$tg</td><td>$tb</td><td>$tn</td><td>$rb</td><td>$rn</td><td>$pr</td></tr>”;
print OUTPUT $outln;
$outln = ‘</table></center></body></html>’;
print OUTPUT $outln;