Skip to content

Instantly share code, notes, and snippets.

@taiyoh
Created May 27, 2010 03:42
Show Gist options
  • Save taiyoh/415423 to your computer and use it in GitHub Desktop.
Save taiyoh/415423 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Glib;
use Irssi;
use Config::Pit;
use WebService::ImKayac;
my $im = WebService::ImKayac->new(
type => 'secret',
%{ pit_get('im.kayac') }
);
our $VERSION = '0.1.1';
our %IRSSI = (
name => 'hilight2im',
description => 'notify hilight message to IM via im.kayac.com api, @ttaiyoh modified',
authors => 'Daisuke Murase',
);
sub sig_printtext {
my ($dest, $text, $stripped) = @_;
if ( $dest->{level} & MSGLEVEL_HILIGHT ) {
$im->send(sprintf('[irssi] %s %s', $dest->{target}, $stripped));
}
}
Irssi::signal_add('print text' => \&sig_printtext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment