index.cgi
#!/usr/bin/perl
use strict;
my @directories = ("_aa_", "elleinad", "dj_testosterone", "sleepy_rabbit", "magic_silver_box", "stats", "m50", "breakfast", "haiku", "poetry", "qrg", "ingofutz", "reack");
print "Content-type: text/html\n\n";
print print_header();
my $a;
while ($a++ < 25) {
my @links = sort { (-1,0,1)[rand 3] } @directories;
foreach (@links) {
print " <a href=\"" . $_ . "\" style=\"" . random_style() . "\">$_</a> \n";
}
}
print print_footer();
sub random_style {
my $size = 6 + int(rand(17));
my $color = random_color(70, 255);
return "font-size:" . $size . "px;color:" . $color . ";text-decoration:none;";
}
sub random_color {
my ($min, $max) = @_;
my $red = $min + int(rand($max - $min));
my $green = $min + int(rand($max - $min));
my $blue = $min + int(rand($max - $min));
return "rgb(" . $red . "," . $green . "," . $blue . ")";
}
sub print_header {
my $body_color = random_color(10,70);
my $header = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" dir=\"ltr\" lang=\"en\">
<head>
<title>anal0g.org</title>
<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" />
</head>
<body style=\"background:" . $body_color . "\">
<center>
<a style=\"font-size:40px;color:black\">a n a l 0 g . o r g</a><br />\n";
return $header;
}
sub print_footer {
my $footer = " </center>
</body>
</html>\n";
return $footer;
}