Send a Message
This script will send a message to the
ALPHA 215C
scrolling LED sign connected to this system.
sendmessage.cgi
#!/usr/bin/perl -w
use CGI qw(:standard escapeHTML);
my $msg = param('MSG');
print "Content-type: text/html\n\n";
if ( $msg EQ "" ) {
print <<EOF;
<HTML>
<HEAD>
<TITLE>Alpha 215C WebPosting Messaging Service</TITLE>
<META NAME="Author" CONTENT="Walt Stoneburner">
<META NAME="Keywords" CONTENT="MindPrint,Mind,Print,Walt,Walter,L,Stone,Burner,Stoneburner,Steinbrenner,Stoneburger,Stoneberger">
<META NAME="Description" CONTENT="This page is connected to a LED scrolling sign, and you can post a message to it.">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>Leave a Message on a LED Sign</H1>
This page is connected to a
<A HREF="http://wls.wwco.com/ledsigns/alpha/215c.html">Alpha 215C</A>
scrolling LED sign.
<P>
By entering in a message below and submitting it,
you can send it to the sign.
<FORM METHOD="POST" ACTION="sendmessage.cgi">
<INPUT TYPE="TEXT" VALUE="" SIZE=65 NAME="MSG">
<P>
<INPUT TYPE="SUBMIT" VALUE="Send">
</FORM>
</BODY>
</HTML>
EOF
exit;
}
print <<EOF;
<HTML>
<HEAD>
<TITLE>Message Sent</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
Your message <TT>
EOF
print escapeHTML($msg);
print <<EOF;
</TT> has been sent.
<P>
You may now <A HREF="sendmessage.cgi">send another</A>
or visit the <A HREF="http://wls.wwco.com/ledsigns/alpha/215c.html">ALPHA
215C</A> page.
</BODY>
</HTML>
EOF
$filename = "/dev/alpha";
open( LED, "> $filename" );
binmode( LED );
# Get the attention of the sign
print LED "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
# Tell the sign to print the message
print LED "\001" . "Z" . "00" . "\002" . "AA" . "\x1B" . " t" . $msg . "\004";
close(LED);
You may run
this script if you like.
|