Well its been almost a year and a half since DigitalConvergance died. But its legacy was not forgotten for geeks all over the world got a neat gadget to hack (see cuecat). I have used one of my cuecats to connect my door to the web. First, I glued a barcode to the side of my door. Next, I propped the cuecat so that when the door swung by it would scan the barcode. Then I wrote this perl script which updates the webstite, incrementing the counter and adding a timestamp, when it gets the barcode information. To see live statistics point your browser to phrontist.org. Here is the code:
#!/usr/bin/perl use strict; my $i = 0; my ($time,$html); while (1) { my $meow = <STDIN>; open(TIME,"date|"); $time = <TIME>; # Get Time close(TIME); $i++; open(WWW,">/usr/home/web/www/index.html") or die "File did not open!\ +n"; $html = <<CATTAIL; <html> <title>The Door Server</title> <body bgcolor="#000000" alink="#ffffff" link="#ffffff" vlink="#ffffff" + text="#ffffff"> <center><table STYLE="border:solid; border-width:1px; border-color:#FF +FFFF"><tr><td><h1>The Door Server</h1></td></tr></table></center> <br> <center> <table STYLE="border:solid; border-width:1px; border-color:#FFFFFF"> <tr> <td> <center><pre> My door has been connected to the 'net through a somewhat unconvention +al use of a <A HREF="http://www.cuecatastrophe.com">CueCat</A> barcode scanner. I have adhered a barcode to the lower corner of my do +or and as it opens and closes it swings by the barcode scanner which sends the barcode in +formation to the FreeBSD (version 4.6) machine it my room. Upon getting this signal a < +A HREF="http://perlmonks.org">perl</A> script running on the machine springs into action and updates this page for your view +ing pleasure. Below you can see live statistics, such as how many times my door has been o +pened/closed and when it was last opened/closed. Enjoy </pre></center> </td> </tr> </table> </center> <br> <center> <table STYLE="border:solid; border-width:1px; border-color:#FFFFFF"> <tr> <td> <pre> <center><H1>Stats:</H1></center> Door Openings/Closings : $i Time Last Opened/Closed: $time </pre> </td> </tr> </table> </center> </body> </html> CATTAIL print WWW "$html" or die "did not print\n"; close(WWW); }


"Sanity is the playground of the unimaginative" -Unknown

In reply to The Door Server by beretboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.