#! /usr/bin/perl -w # WPoison on-line has disappeared. This is my own quick # replacement hack - YR 2004 # The script uses /usr/share/dict/words as a source of # words. Debian's 'wamerican' package provides such a file. use strict; # returns a random word from a dict file sub random_word { my $f = shift; my $seek = rand ( -s $f ); seek $f, $seek, 0; my $word = <$f>; # read till EOL (as we probably seeked in the middle of a word) $word = <$f>; chop $word; return $word; } sub random_email { my $f = shift; my $to = random_word $f; my $domain = random_word $f; my @tlds = qw/com org net fr co.uk ac.uk com.au de/; my $tld = $tlds[rand $#tlds]; return "$to\@$domain.$tld"; } sub make_sentence { my ( $f, $num ) = @_; my ( $out ); for my $i ( 1..$num) { $out .= random_word $f; $out .= " "; } return "$out"; } sub make_paragraph { my ( $f ) = @_; my $out; $out .= "
"; for my $i ( 1 .. int rand 10 ) { $out .= (make_sentence $f, 10 + rand 10); my $addr = random_email $f; $out .= "$addr "; $out .= (make_sentence $f, 10 + rand 10); my $link = "rpoison.cgi?$addr"; $out .= "".(random_word $f)." "; } $out .= "
\n\n"; } print <This is a page with random, automatically generated content. It contains nothing of interest to humans, and is only here to lose robots that harvest e-mail addresses from Web sites into infinite amounts of useless data.
EOF open my $f, "/usr/share/dict/words" or die "no words file found\n"; my $par_num = 5 + int rand 10; # 5 to to 15 paragraphs print make_paragraph $f while $par_num--; print <