use strict; use Data::Random::WordList; use CGI qw/:standard/; my $cgi = CGI->new(); my ($punct, # punctuation, . ! ? or : @punct, $punc, $tld); # top-level domain my $log = "/webroot/logs/raid"; my $wordlist = "/usr/share/dict/american-english"; ######################################################### # To activate this in Apache, add these two lines to your # httpd.conf in the appropriate section: # # AddHandler cgi-script .cgi .pl # AliasMatch ^/raid/.* /path/to/this/cgi/raid.pl # ^^^^^ my $ap_alias = "/raid/"; ######################################################### # list of domains hosted on this machine that will always # point to this script: my @domains = qw/www.foo.bar foo.bar foo.com/; # Throttle # sleep(10); # wrapped for Perl Monks, this is not a multi-line regex exit if ($ENV{HTTP_USER_AGENT} =~ /google|Googlebot| inktomi|search| altavista|wget|htdig/i); if (-e $log ) { open LOG, ">>$log"; } else { open LOG, ">$log"; } my $time = localtime; print LOG "$time $ENV{'REMOTE_ADDR'} $ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'}" . " $ENV{'HTTP_REFERER'} \"$ENV{'HTTP_USER_AGENT'}\"\n"; close LOG; $punct[1] = "."; $punct[2] = "!"; $punct[3] = "\?"; $punct[4] = ":"; my $numurl = my @url = map { "${_}${ap_alias}" } @domains; ######################################################### # Select 'n' words at random from the list, sorted my $wl = new Data::Random::WordList( wordlist => '/usr/share/dict/american-english'); my @word = $wl->get_words(2000); $wl->close(); my $wordnum = @word; # Create a random title from those random words in the list my $title = $word[int(rand $wordnum)] . " " . $word[int(rand $wordnum)] . " " . $word[int(rand $wordnum)] . " " . $word[int(rand $wordnum)]; print $cgi->header(), start_html(-title => "$title", -bgcolor => '#ffffff'); my $para = int(rand 10)+3; my $pagenum = 0; while($pagenum < $para) { $pagenum++; my $words_in_page = int(rand 80)+10; my $total_words = 0; while($total_words < $words_in_page) { $total_words++; my $prword = $word[int(rand $wordnum)]; print "$prword"; if((rand 10)<1) { $punc = $punct[int(rand 4)+1]; print $punc . br() . "\n"; } print " "; } print br(), "\n"; my $num_addr = int(rand 10)+10; my $pres_addr = 0; while ($pres_addr < $num_addr) { my $urlpos; $pres_addr++; my $name = $word[int(rand $wordnum)]; my $d1 = $word[int(rand $wordnum)]; my $d2 = $word[int(rand $wordnum)]; if((rand 4)>1) { if((rand 3)>1) { $tld = "com"; } else { $tld = "net"; } } else { $tld = "org"; } my $mailaddr = $name . '@' . $d1 . $d2 . "." . $tld; if((rand 4)>3) { my $urlh = "http://"; my $urlb = $url[int(rand $numurl)]; my $urlt = $word[int(rand $wordnum)]; if ((rand 5)>1) { $urlt .= ".html"; } else { $urlt .= "/"; } $urlpos = $urlh . $urlb . $urlt; } else { $urlpos = "mailto:" . $mailaddr; } print a({-href => "$urlpos"}, "$mailaddr"), br(), "\n"; } } print end_html(), "\n"; exit;

In reply to Can-o-Raid v1.0 by hacker

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.