|
Revision 14756, 0.8 kB
(checked in by mash, 4 years ago)
|
|
initial import of hilight2skype, forward irssi hilighted messages to your skype
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use warnings; |
|---|
| 3 | |
|---|
| 4 | use Irssi; |
|---|
| 5 | use IPC::Run qw(run); |
|---|
| 6 | |
|---|
| 7 | use vars qw($VERSION %IRSSI); |
|---|
| 8 | $VERSION = "0.1"; |
|---|
| 9 | %IRSSI = ( |
|---|
| 10 | authors => 'Masakazu OHTSUKA (mash)', |
|---|
| 11 | name => 'hilight2skype', |
|---|
| 12 | description => 'forward hilighted messages to your skype', |
|---|
| 13 | url => 'http://maaash.jp/', |
|---|
| 14 | changed => '2008-06-06', |
|---|
| 15 | ); |
|---|
| 16 | |
|---|
| 17 | sub forward_to_skype { |
|---|
| 18 | my ( $dest, $text, $stripped ) = @_; |
|---|
| 19 | |
|---|
| 20 | my $config = { |
|---|
| 21 | skype_id => 'your_skype_id', |
|---|
| 22 | script => "$ENV{HOME}/.irssi/scripts/autorun/hilight2skype/send_chat_message.py", |
|---|
| 23 | }; |
|---|
| 24 | |
|---|
| 25 | my $window = Irssi::active_win(); |
|---|
| 26 | |
|---|
| 27 | if ( $dest->{level} & MSGLEVEL_HILIGHT ) { |
|---|
| 28 | my @cmd = ($config->{script}, $config->{skype_id}, '[irssi '.$dest->{target}.'] '.$stripped); |
|---|
| 29 | run \@cmd; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | Irssi::signal_add( 'print text' => \&forward_to_skype ); |
|---|