# # $Id: linux.pl,v 1.12 2004/01/11 17:50:59 nugget Exp $ # use Irssi; use Irssi::Irc; my $cvsid = '$Id: linux.pl,v 1.12 2004/01/11 17:50:59 nugget Exp $'; my $version = '?'; if( $cvsid =~ /\$Id: [^ ]+ (\d+\.\d+)/ ) { $version = $1; } sub gnuxlate { my ($server, $data, $nick, $address) = @_; my ($target, $text) = split(/ :/, $data, 2); my @ignorenicks = ('ntook','dctievent','udevent','gigo','url'); my $randstring = randomPassword(6); my $changed = 0; $text = " " . $text . " "; if(($text =~ /linux/i) || ($text =~ / poo[\.\!\? \-\']/i)) { $text =~ s/linux/$randstring/gi; $text =~ s/ poo/ linux/gi; $text =~ s/$randstring/poo/gi; $changed = 1; } if($text =~ / RMS/i) { $text =~ s/ RMS/ a smelly hippie/i; $changed = 1; } if($text =~ / GPL/i) { $text =~ s/ GPL/ GPV/i; $changed = 1; } if($text =~ /free software/i) { $text =~ s/free software/gpl-infected software/i; $changed = 1; } if($text =~ / share /i) { $text =~ s/ share / pirate /i; $changed = 1; } if($changed>0) { $text = substr($text,1,length($text)-2); $server->print($target,"<$nick> $text", MSGLEVEL_PUBLIC); Irssi::signal_stop(); } } Irssi::signal_add("event privmsg", "gnuxlate"); Irssi::print("gnuxlate handler v$version loaded..."); sub randomPassword { my $password; my $_rand; my $password_length = $_[0]; if (!$password_length) { $password_length = 10; } my @chars = split(" ", "a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"); srand; for (my $i=0; $i <= $password_length ;$i++) { $_rand = int(rand 67); $password .= $chars[$_rand]; } return $password; }