Quite some time ago I read a rant complaining about how information on the internet doesn't age our wear down. I thought it was pretty interesting, but I forgot about it till now. Anyway, I wrote this little script that allows users to post messages that fade away over time (more specifically they fade a little every time the page gets a hit) and eventually dissapear. You can see this running here. And here is the code:
#!/usr/bin/perl use strict; use CGI qw( header param ); my $new = param("post"); my @pallet = qw( 000000 1E1E1E 3C3C3C 5A5A5A 787878 969696 B4B4B4 D2D2 +D2 F0F0F0 ); my $url = "http://yoursite.org/url/for/cgi"; if ($new) { open(POSTS, ">>/path/to/message/file"); print POSTS "0 $new\n"; print header; print "<PRE>meme added\n<A HREF=\"$url">go back</a></pre>"; } else { open(POSTS,"/path/to/message/file"); my @posts = <POSTS>; my $post; print header; foreach $post(@posts) { $post =~ /(\d) (.*)/; my $shade = @pallet[$1]; my $text = $2; my $x = int(rand 400); my $y = int(rand 400); my $z = int(rand 5); $z++; print "<font color=#$shade size=$z STYLE=\"position:relative; left:" . + $x . "px; top:" . $y . "px\"> $text </font>\n"; } close(POSTS); open(POSTS, ">/path/to/message/file"); foreach $post(@posts) { $post =~ /(\d) (.*)/; my $num = $1; my $mesg = $2; $num++; if ($num == 9) { 1; } else { print POSTS "$num $mesg\n"; } } print <<CREATE; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <table> <tr> <td bgcolor=#08082C> <BR> <FORM METHOD="GET" ACTION="$url"> Meme:<INPUT TYPE="text" STYLE="background-color:#B4B4B4" NAME="post" S +IZE="30"> <INPUT TYPE="submit" value="create"> </form> <BR> </td> </tr> </table> CREATE }
BTW I know all those BR tags are annoying, sorry about that

"Sanity is the playground of the unimaginative" -Unknown

In reply to Fading Message Board 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.