#!/usr/bin/perl
use strict;
use CGI qw( header param );
my $new = param("post");
my @pallet = qw( 000000 1E1E1E 3C3C3C 5A5A5A 787878 969696 B4B4B4 D2D2D2 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 "
meme added\ngo back
";
} else {
open(POSTS,"/path/to/message/file");
my @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 " $text \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
}