#!/usr/bin/perl # Sends clue packets to the GNOME Dashboard application (see # http://www.nat.org/dashboard). Does not do any interpretation # Of cluepackets, and only sends $msg with type textblock. # Christopher Schmidt -- crschmid@uiuc.edu # Martijn van Beers -- martijn@eekeek.org use Irssi; use Irssi::Irc; use Dashboard; $VERSION = "0.2"; %IRSSI = ( authors => 'Multiple: See Source', contact => 'Multiple: See Source', name => 'cluepacket', description => 'Sends cluepackets to dashboard', license => 'Unlimited', url => 'http://dashboard.crschmidt.net', ); my %logs; sub on_public { my ($server, $msg, $nick, $addr, $target) = @_; $Festival = Festival::Client->New("my.festival.server"); $nick = $server->{'nick'} if ($nick =~ /^#/); my $window = Irssi::active_win(); my $w = $window->{'active'}; my $name = $w->{'name'}; if (!$target || $target eq $name) { $Festival->say("$nick said $msg"); } } sub send_clues { my ($name, $msg) = @_; #my $count = @list; #$server->print ($name, "($target, $name) sending $count clues", MSGLEVEL_NO_ACT); @list = map { { data => $_, type => "textblock", relevance => 10, } } @list; $dash->send_cluepacket("$name", 1, \@list); } # FIXME: add ability to turn on/off cluepacket sending. # Put hooks on events Irssi::signal_add_last("message public", "on_public"); Irssi::signal_add_last("message own_public", "on_public"); Irssi::signal_add_last("window item changed", "on_win_changed"); Irssi::signal_add_last("window changed", "on_win_changed"); 1;