# Jon's irssi script use strict; use vars qw($VERSION %IRSSI); use Irssi; $VERSION = '1.00'; %IRSSI = ( authors => 'Jon Dowland', contact => 'jon+irssi@alcopop.org', name => 'outbound text filtering', description => 'This script allows ' . 'you to apply substitutions '. 'to all outgoing text.', license => 'Public Domain', ); my %repl = ( "..." => "…", "<3" => "♥", "o/~" => "♪", ":-)" => "☺", ":-(" => "☹", "NIN" => "NIИ", ); sub handle_event { my ($line, $server, $witem) = @_; foreach my $key (keys %repl) { $line =~ s/\Q$key\E/$repl{$key}/g; } Irssi::signal_continue($line,$server,$witem); } Irssi::signal_add("send text", \&handle_event);