From c47159802b57da25f6258e784f2b425b52e35e72 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 31 Oct 2014 18:55:19 +0100 Subject: irssi: adding used scripts and their autorun symlinks (scriptassist is a system symlink!) --- .irssi/scripts/autorun/bitlbee_blist.pl | 1 + .irssi/scripts/autorun/bitlbee_join_notice.pl | 1 + .irssi/scripts/autorun/bitlbee_nick_change.pl | 1 + .irssi/scripts/autorun/bitlbee_tab_completion.pl | 1 + .irssi/scripts/autorun/bitlbee_timestamp.pl | 1 + .irssi/scripts/autorun/bitlbee_typing_notice.pl | 1 + .irssi/scripts/autorun/extaway.pl | 1 + .irssi/scripts/autorun/irccomplete.pl | 1 + .irssi/scripts/autorun/lastfm.pl | 1 + .irssi/scripts/autorun/ls.pl | 1 + .irssi/scripts/autorun/nicklist.pl | 1 + .irssi/scripts/autorun/nickserv.pl | 1 + .irssi/scripts/autorun/scriptassist.pl | 1 + .irssi/scripts/autorun/tmux_away.pl | 1 + .irssi/scripts/bitlbee_blist.pl | 61 ++ .irssi/scripts/bitlbee_join_notice.pl | 108 +++ .irssi/scripts/bitlbee_nick_change.pl | 72 ++ .irssi/scripts/bitlbee_tab_completion.pl | 88 +++ .irssi/scripts/bitlbee_timestamp.pl | 105 +++ .irssi/scripts/bitlbee_typing_notice.pl | 319 +++++++++ .irssi/scripts/extaway.pl | 194 ++++++ .irssi/scripts/irccomplete.pl | 210 ++++++ .irssi/scripts/lastfm.pl | 447 +++++++++++++ .irssi/scripts/ls.pl | 40 ++ .irssi/scripts/nicklist.pl | 805 +++++++++++++++++++++++ .irssi/scripts/nickserv.pl | 563 ++++++++++++++++ .irssi/scripts/tmux_away.pl | 179 +++++ 27 files changed, 3205 insertions(+) create mode 120000 .irssi/scripts/autorun/bitlbee_blist.pl create mode 120000 .irssi/scripts/autorun/bitlbee_join_notice.pl create mode 120000 .irssi/scripts/autorun/bitlbee_nick_change.pl create mode 120000 .irssi/scripts/autorun/bitlbee_tab_completion.pl create mode 120000 .irssi/scripts/autorun/bitlbee_timestamp.pl create mode 120000 .irssi/scripts/autorun/bitlbee_typing_notice.pl create mode 120000 .irssi/scripts/autorun/extaway.pl create mode 120000 .irssi/scripts/autorun/irccomplete.pl create mode 120000 .irssi/scripts/autorun/lastfm.pl create mode 120000 .irssi/scripts/autorun/ls.pl create mode 120000 .irssi/scripts/autorun/nicklist.pl create mode 120000 .irssi/scripts/autorun/nickserv.pl create mode 120000 .irssi/scripts/autorun/scriptassist.pl create mode 120000 .irssi/scripts/autorun/tmux_away.pl create mode 100644 .irssi/scripts/bitlbee_blist.pl create mode 100644 .irssi/scripts/bitlbee_join_notice.pl create mode 100644 .irssi/scripts/bitlbee_nick_change.pl create mode 100644 .irssi/scripts/bitlbee_tab_completion.pl create mode 100644 .irssi/scripts/bitlbee_timestamp.pl create mode 100644 .irssi/scripts/bitlbee_typing_notice.pl create mode 100644 .irssi/scripts/extaway.pl create mode 100644 .irssi/scripts/irccomplete.pl create mode 100644 .irssi/scripts/lastfm.pl create mode 100644 .irssi/scripts/ls.pl create mode 100644 .irssi/scripts/nicklist.pl create mode 100644 .irssi/scripts/nickserv.pl create mode 100644 .irssi/scripts/tmux_away.pl (limited to '.irssi/scripts') diff --git a/.irssi/scripts/autorun/bitlbee_blist.pl b/.irssi/scripts/autorun/bitlbee_blist.pl new file mode 120000 index 0000000..a0fff54 --- /dev/null +++ b/.irssi/scripts/autorun/bitlbee_blist.pl @@ -0,0 +1 @@ +../bitlbee_blist.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/bitlbee_join_notice.pl b/.irssi/scripts/autorun/bitlbee_join_notice.pl new file mode 120000 index 0000000..c4c5afc --- /dev/null +++ b/.irssi/scripts/autorun/bitlbee_join_notice.pl @@ -0,0 +1 @@ +../bitlbee_join_notice.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/bitlbee_nick_change.pl b/.irssi/scripts/autorun/bitlbee_nick_change.pl new file mode 120000 index 0000000..773c4c4 --- /dev/null +++ b/.irssi/scripts/autorun/bitlbee_nick_change.pl @@ -0,0 +1 @@ +../bitlbee_nick_change.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/bitlbee_tab_completion.pl b/.irssi/scripts/autorun/bitlbee_tab_completion.pl new file mode 120000 index 0000000..caca874 --- /dev/null +++ b/.irssi/scripts/autorun/bitlbee_tab_completion.pl @@ -0,0 +1 @@ +../bitlbee_tab_completion.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/bitlbee_timestamp.pl b/.irssi/scripts/autorun/bitlbee_timestamp.pl new file mode 120000 index 0000000..54360ae --- /dev/null +++ b/.irssi/scripts/autorun/bitlbee_timestamp.pl @@ -0,0 +1 @@ +../bitlbee_timestamp.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/bitlbee_typing_notice.pl b/.irssi/scripts/autorun/bitlbee_typing_notice.pl new file mode 120000 index 0000000..9c4da39 --- /dev/null +++ b/.irssi/scripts/autorun/bitlbee_typing_notice.pl @@ -0,0 +1 @@ +../bitlbee_typing_notice.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/extaway.pl b/.irssi/scripts/autorun/extaway.pl new file mode 120000 index 0000000..9ad9ba0 --- /dev/null +++ b/.irssi/scripts/autorun/extaway.pl @@ -0,0 +1 @@ +../extaway.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/irccomplete.pl b/.irssi/scripts/autorun/irccomplete.pl new file mode 120000 index 0000000..2fe4b47 --- /dev/null +++ b/.irssi/scripts/autorun/irccomplete.pl @@ -0,0 +1 @@ +../irccomplete.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/lastfm.pl b/.irssi/scripts/autorun/lastfm.pl new file mode 120000 index 0000000..a663918 --- /dev/null +++ b/.irssi/scripts/autorun/lastfm.pl @@ -0,0 +1 @@ +../lastfm.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/ls.pl b/.irssi/scripts/autorun/ls.pl new file mode 120000 index 0000000..e878d30 --- /dev/null +++ b/.irssi/scripts/autorun/ls.pl @@ -0,0 +1 @@ +../ls.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/nicklist.pl b/.irssi/scripts/autorun/nicklist.pl new file mode 120000 index 0000000..53812ea --- /dev/null +++ b/.irssi/scripts/autorun/nicklist.pl @@ -0,0 +1 @@ +../nicklist.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/nickserv.pl b/.irssi/scripts/autorun/nickserv.pl new file mode 120000 index 0000000..c3fef2b --- /dev/null +++ b/.irssi/scripts/autorun/nickserv.pl @@ -0,0 +1 @@ +../nickserv.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/scriptassist.pl b/.irssi/scripts/autorun/scriptassist.pl new file mode 120000 index 0000000..f192fad --- /dev/null +++ b/.irssi/scripts/autorun/scriptassist.pl @@ -0,0 +1 @@ +/usr/share/irssi/scripts/scriptassist.pl \ No newline at end of file diff --git a/.irssi/scripts/autorun/tmux_away.pl b/.irssi/scripts/autorun/tmux_away.pl new file mode 120000 index 0000000..70df40e --- /dev/null +++ b/.irssi/scripts/autorun/tmux_away.pl @@ -0,0 +1 @@ +../tmux_away.pl \ No newline at end of file diff --git a/.irssi/scripts/bitlbee_blist.pl b/.irssi/scripts/bitlbee_blist.pl new file mode 100644 index 0000000..179b539 --- /dev/null +++ b/.irssi/scripts/bitlbee_blist.pl @@ -0,0 +1,61 @@ +use strict; +use vars qw($VERSION %IRSSI); + +$VERSION = '0.4'; +%IRSSI = ( + authors => 'Tijmen "timing" Ruizendaal', + contact => 'tijmen.ruizendaal@gmail.com', + name => 'bitlbee_blist', + description => '/blist , greps from blist for bitlbee', + license => 'GPLv2', + url => 'http://the-timing.nl/stuff/irssi-bitlbee', + changed => '2006-10-27', +); + +my $bitlbee_server_tag = "localhost"; +my $bitlbee_channel = "&bitlbee"; +my ($list, $word); + +get_channel(); + +Irssi::signal_add_last 'channel sync' => sub { + my( $channel ) = @_; + if( $channel->{topic} eq "Welcome to the control channel. Type \x02help\x02 for help information." ){ + $bitlbee_server_tag = $channel->{server}->{tag}; + $bitlbee_channel = $channel->{name}; + } +}; + +sub get_channel { + my @channels = Irssi::channels(); + foreach my $channel(@channels) { + if ($channel->{topic} eq "Welcome to the control channel. Type \x02help\x02 for help information.") { + $bitlbee_channel = $channel->{name}; + $bitlbee_server_tag = $channel->{server}->{tag}; + return 1; + } + } + return 0; +} + +sub blist { + my ($args, $server, $winit) = @_; + ($list, $word) = split(/ /, $args, 2); + if (Irssi::active_win->{'active'}->{'name'} eq $bitlbee_channel) { + Irssi::active_win()->command("msg $bitlbee_channel blist $list"); + Irssi::signal_add('event privmsg', 'grep'); + } else { + print "Only use in $bitlbee_channel."; + } +} + +sub grep { + my ($server, $data, $nick, $address) = @_; + my ($target, $text) = split(/ :/, $data, 2); + if ($text =~ /$word/ && $target =~ /$bitlbee_channel/){ + ##do nothing + } else {Irssi::signal_stop();} + if ($text =~ /buddies/ && $target =~/$bitlbee_channel/){Irssi::signal_remove('event privmsg', 'grep');} +} + +Irssi::command_bind('blist','blist'); diff --git a/.irssi/scripts/bitlbee_join_notice.pl b/.irssi/scripts/bitlbee_join_notice.pl new file mode 100644 index 0000000..6644895 --- /dev/null +++ b/.irssi/scripts/bitlbee_join_notice.pl @@ -0,0 +1,108 @@ +# CHANGELOG: +# +# 2010-08-10 (version 1.3) +# * new bitlbee server detection +# +# 2004-11-28: +# * adds join message to query +# +# /statusbar window add join_notice +# use Data::Dumper; + +#use strict; +use Irssi::TextUI; +#use Irssi::Themes; +use Data::Dumper; + +use vars qw($VERSION %IRSSI); + +$VERSION = '1.3'; +%IRSSI = ( + authors => 'Tijmen "timing" Ruizendaal', + contact => 'tijmen.ruizendaal@gmail.com', + name => 'BitlBee_join_notice', + description => '1. Adds an item to the status bar wich shows [joined: ] when someone is joining &bitlbee. 2. Shows join messages in the query. (For bitlbee v3.0+)', + license => 'GPLv2', + url => 'http://the-timing.nl/stuff/irssi-bitlbee', + changed => '2010-08-10' +); +my %timers; +my $bitlbee_server; # server object +my @control_channels; # mostly: &bitlbee, &facebook etc. +init(); + +sub init { # if script is loaded after connect + my @servers = Irssi::servers(); + foreach my $server(@servers) { + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + my @channels = $server->channels(); + foreach my $channel(@channels) { + if( $channel->{mode} =~ /C/ ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } + } + } + } +} +# if connect after script is loaded +Irssi::signal_add_last('event 005' => sub { + my( $server ) = @_; + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + } +}); +# if new control channel is synced after script is loaded +Irssi::signal_add_last('channel sync' => sub { + my( $channel ) = @_; + if( $channel->{mode} =~ /C/ && $channel->{server}->{tag} eq $bitlbee_server->{tag} ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } +}); + +# BEGIN bitlbee_join_notice.pl + +my %online; + +sub event_join { + my ($server, $channel, $nick, $address) = @_; + $channel =~ s/^://g; + if ( (grep $_ eq $channel, @control_channels) && $server->{tag} eq $bitlbee_server->{tag}){ + $online{$nick} = 1; + Irssi::timeout_remove($timers{$nick}); + delete($timers{$nick}); + $timers{$nick} = Irssi::timeout_add_once(7000, 'empty', $nick); + Irssi::statusbar_items_redraw('join_notice'); + my $window = Irssi::window_find_item($nick); + if($window){ + $window->printformat(Irssi::MSGLEVEL_JOINS, 'join', $nick, $address, $channel); + } + } +} +sub join_notice { + my ($item, $get_size_only) = @_; + my $line; + foreach my $key (keys(%online) ){ + $line = $line." ".$key; + } + if ($line ne "" ){ + $item->default_handler($get_size_only, "{sb joined:$line}", undef, 1); + $line = ""; + } else { + $item->default_handler($get_size_only, "", undef, 1); + } +} +sub empty { + my $nick = shift; + delete($online{$nick}); + Irssi::timeout_remove($timers{$nick}); + delete($timers{$nick}); + Irssi::statusbar_items_redraw('join_notice'); +} + +Irssi::signal_add('event join', 'event_join' ); +Irssi::statusbar_item_register('join_notice', undef, 'join_notice'); +Irssi::statusbars_recreate_items(); +Irssi::theme_register([ 'join', '{channick_hilight $0} {chanhost $1} has joined {channel $2}', ]); + +# END bitlbee_join_notice.pl diff --git a/.irssi/scripts/bitlbee_nick_change.pl b/.irssi/scripts/bitlbee_nick_change.pl new file mode 100644 index 0000000..93a01b9 --- /dev/null +++ b/.irssi/scripts/bitlbee_nick_change.pl @@ -0,0 +1,72 @@ +use strict; +use Data::Dumper; +use vars qw($VERSION %IRSSI); + +$VERSION = '1.3'; +%IRSSI = ( + authors => 'Tijmen "timing" Ruizendaal', + contact => 'tijmen.ruizendaal@gmail.com', + name => 'BitlBee_nick_change', + description => 'Shows an IM nickchange in an Irssi way. (in a query and in the bitlbee channel). (For bitlbee 3.0+)', + license => 'GPLv2', + url => 'http://the-timing.nl/stuff/irssi-bitlbee', + changed => '2010-07-28' +); + +my $bitlbee_server; # server object +my @control_channels; # mostly: &bitlbee, &facebook etc. +init(); + +sub init { # if script is loaded after connect + my @servers = Irssi::servers(); + foreach my $server(@servers) { + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + my @channels = $server->channels(); + foreach my $channel(@channels) { + if( $channel->{mode} =~ /C/ ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } + } + } + } +} +# if connect after script is loaded +Irssi::signal_add_last('event 005' => sub { + my( $server ) = @_; + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + } +}); +# if new control channel is synced after script is loaded +Irssi::signal_add_last('channel sync' => sub { + my( $channel ) = @_; + if( $channel->{mode} =~ /C/ && $channel->{server}->{tag} eq $bitlbee_server->{tag} ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } +}); + +# BEGIN bitlbee_nick_change.pl + +sub event_notice { + my ($server, $msg, $nick, $address, $target) = @_; + if( $server->{tag} eq $bitlbee_server->{tag} && $msg =~ /.*Changed name to.*/ ){ + my $friendly_name = $msg; + $friendly_name =~ s/.*Changed name to `(.*)'.*/$1/; + my $window = $server->window_find_item($nick); + if ($window) { + $window->printformat(MSGLEVEL_CRAP, 'nick_change', $nick, $address, 'changed name to `'.$friendly_name.'`'); + Irssi::signal_stop(); + } else { + # TODO find control channel where this user is located and display the notice there + #my $window = $server->window_find_item($bitlbee_channel); + #$window->printformat(MSGLEVEL_CRAP, 'nick_change', $nick, $address, 'changed name to `'.$friendly_name.'`'); + #Irssi::signal_stop(); + } + } +}; + +Irssi::signal_add_last('message irc notice', 'event_notice'); +Irssi::theme_register(['nick_change', '{channick_hilight $0} [$1] $2']); + +# END bitbee_nick_change.pl diff --git a/.irssi/scripts/bitlbee_tab_completion.pl b/.irssi/scripts/bitlbee_tab_completion.pl new file mode 100644 index 0000000..8d19128 --- /dev/null +++ b/.irssi/scripts/bitlbee_tab_completion.pl @@ -0,0 +1,88 @@ +use strict; +use vars qw($VERSION %IRSSI); + +$VERSION = '1.3'; + +%IRSSI = ( + authors => 'Tijmen "timing" Ruizendaal & Wilmer van der Gaast', + contact => 'tijmen.ruizendaal@gmail.com', + name => 'BitlBee_tab_completion', + description => 'Intelligent Tab-completion for BitlBee commands.', + license => 'GPLv2', + url => 'http://the-timing.nl/stuff/irssi-bitlbee', + changed => '2009-08-11', +); + +my $root_nick = 'root'; +my $bitlbee_channel = '&bitlbee'; +my $bitlbee_server_tag = 'localhost'; +my $get_completions = 0; + +my @commands; + +Irssi::signal_add_last 'channel sync' => sub { + my( $channel ) = @_; + if( $channel->{topic} eq "Welcome to the control channel. Type \x02help\x02 for help information." ){ + $bitlbee_server_tag = $channel->{server}->{tag}; + $bitlbee_channel = $channel->{name}; + request_completions(); + } +}; + +if (get_channel()) { + request_completions(); +} + +sub request_completions { + $get_completions = 1; + Irssi::server_find_tag($bitlbee_server_tag)->send_raw( 'COMPLETIONS' ); +} + +sub get_channel { + my @channels = Irssi::channels(); + foreach my $channel(@channels) { + if ($channel->{topic} eq "Welcome to the control channel. Type \x02help\x02 for help information.") { + $bitlbee_channel = $channel->{name}; + $bitlbee_server_tag = $channel->{server}->{tag}; + return 1; + } + } + return 0; +} + +sub irc_notice { + return unless $get_completions; + my( $server, $msg, $from, $address, $target ) = @_; + + if( $msg =~ s/^COMPLETIONS // ) { + $root_nick = $from; + if( $msg eq 'OK' ) { + @commands = (); + } + elsif( $msg eq 'END' ) { + $get_completions = 0; + } + @commands = ( @commands, $msg ); + + Irssi::signal_stop(); + } +} + +sub complete_word { + my ($complist, $window, $word, $linestart, $want_space) = @_; + my $channel = $window->get_active_name(); + if ($channel eq $bitlbee_channel or $channel eq $root_nick or $linestart =~ /^\/(msg|query) \Q$root_nick\E */i){ + $linestart =~ s/^\/(msg|query) \Q$root_nick\E *//i; + $linestart =~ s/^\Q$root_nick\E[:,] *//i; + foreach my $command(@commands) { + if ($command =~ /^$word/i) { + push @$complist, $command; + } + } + } +} + + +Irssi::signal_add_last('complete word', 'complete_word'); +Irssi::signal_add_first('message irc notice', 'irc_notice'); + diff --git a/.irssi/scripts/bitlbee_timestamp.pl b/.irssi/scripts/bitlbee_timestamp.pl new file mode 100644 index 0000000..7957d57 --- /dev/null +++ b/.irssi/scripts/bitlbee_timestamp.pl @@ -0,0 +1,105 @@ +use strict; +use Data::Dumper; +use vars qw($VERSION %IRSSI); +use DateTime; + +$VERSION = '0.5'; +%IRSSI = ( + authors => 'Tijmen "timing" Ruizendaal', + contact => 'tijmen.ruizendaal@gmail.com', + name => 'bitlbee_timestamp', + description => 'Replace Irssi\'s timestamps with those sent by BitlBee', + license => 'GPLv2', + url => 'http://the-timing.nl/stuff/irssi-bitlbee', + changed => '2010-05-01', +); + +my $tf = Irssi::settings_get_str('timestamp_format'); + +my $bitlbee_server; # server object +my @control_channels; # mostly: &bitlbee, &facebook etc. +init(); + +sub init { # if script is loaded after connect + my @servers = Irssi::servers(); + foreach my $server(@servers) { + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + my @channels = $server->channels(); + foreach my $channel(@channels) { + if( $channel->{mode} =~ /C/ ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } + } + } + } +} +# if connect after script is loaded +Irssi::signal_add_last('event 005' => sub { + my( $server ) = @_; + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + } +}); +# if new control channel is synced after script is loaded +Irssi::signal_add_last('channel sync' => sub { + my( $channel ) = @_; + if( $channel->{mode} =~ /C/ && $channel->{server}->{tag} eq $bitlbee_server->{tag} ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } +}); + +my $prev_date = ''; + +sub privmsg { + my ($server, $data, $nick, $address) = @_; + + # What we need to match: ^B[^B^B^B2010-03-21 16:33:41^B]^B + + if( $server->{tag} eq $bitlbee_server->{tag} ){ + + my ($target, $text) = split(/ :/, $data, 2); + + #if( $text =~ /^B[^B^B^B[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}^B]^B/ ){ + + if( $text =~ /\x02\[\x02\x02\x02.*\x02\]\x02/ ){ + my $window; + my $timestamp = $text; + my $time; + my $date; + $timestamp =~ s/.*\x02\[\x02\x02\x02(.*?)\x02\]\x02.*/$1/g; + $text =~ s/\x02\[\x02\x02\x02(.*?)\x02\]\x02 //g; + + ($date, $time) = split(/ /, $timestamp); + if( !$time ){ # the timestamp doesn't have a date + $time = $date; + # use today as date + $date = DateTime->now->ymd; + } + + if( $date ne $prev_date ){ + if( $target =~ /#|&/ ){ # find channel window based on target + $window = Irssi::window_find_item($target); + } else { # find query window based on nick + $window = Irssi::window_find_item($nick); + } + if( $window != undef ){ + my($year, $month, $day) = split(/-/, $date); + my $dt = DateTime->new(year => $year, month => $month, day => $day); + my $formatted_date = $day.' '.$dt->month_abbr.' '.$year; + + $window->print('Day changed to '.$formatted_date, MSGLEVEL_NEVER); + } + } + $prev_date = $date; + + Irssi::settings_set_str('timestamp_format', $time); + Irssi::signal_continue($server, $target . ' :' . $text, $nick, $address); + my $escaped = $tf; + $escaped =~ s/%/%%/g; + Irssi::settings_set_str('timestamp_format', $tf); + } + } +} + +Irssi::signal_add('event privmsg', 'privmsg'); diff --git a/.irssi/scripts/bitlbee_typing_notice.pl b/.irssi/scripts/bitlbee_typing_notice.pl new file mode 100644 index 0000000..50fe47c --- /dev/null +++ b/.irssi/scripts/bitlbee_typing_notice.pl @@ -0,0 +1,319 @@ +# INSTALLATION +# [&bitlbee] set typing_notice true +# <@root> typing_notice = `true' +# AND +# /statusbar window add typing_notice +# +# SETTINGS +# [bitlbee] +# bitlbee_send_typing = ON +# -> send typing messages to buddies +# bitlbee_typing_allwin = OFF +# -> show typing notifications in all windows +# +# +# Changelog: +# +# 2010-08-09 (version 1.7.1) +# * Multiple control channels supported by checking chanmodes +# +# 2010-07-27 (version 1.7) +# * Using new server detection for latest BitlBee support +# +# 2010-07-26 (version 1.6.3) +# * Removed checking if nicks exists in &bitlbee channel, this because BitlBee +# can be used without control channel from this date +# +# 2007-03-03 (version 1.6.2) +# * Fix: timers weren't deleted correctly. This resulted in huge mem usage. +# +# 2006-11-02 (version 1.6.1) +# * Sending typing works again. +# +# 2006-10-27 (version 1.6) +# * 'channel sync' re-implemented. +# * bitlbee_send_typing was a string setting, It's a boolean now, like it should. +# +# 2006-10-24 (version 1.5) +# * Sending notices to online users only. ( removed this again at 2010-07-26, see above ) +# * Using the new get_channel function; +# +# 2005-12-15 (version 1.42): +# * Fixed small bug with typing notices disappearing under certain circumstances +# in channels +# * Fixed bug that caused outgoing notifications not to work +# * root cares not about our typing status. +# +# 2005-12-04 (version 1.41): +# * Implemented stale states in statusbar (shows "(stale)" for OSCAR connections) +# * Introduced bitlbee_typing_allwin (default OFF). Set this to ON to make +# typing notifications visible in all windows. +# +# 2005-12-03 (version 1.4): +# * Major code cleanups and rewrites for bitlbee 1.0 with the updated typing +# scheme. TYPING 0, TYPING 1, and TYPING 2 are now supported from the server. +# * Stale states (where user has typed in text but has stopped typing) are now +# recognized. +# * Bug where user thinks you are still typing if you close the window after +# typing something and then erasing it quickly.. fixed. +# * If a user signs off while they are still typing, the notification is removed +# This update by Matt "f0rked" Sparks +# +# 2005-08-26: +# Some fixes for AIM, Thanks to Dracula. +# +# 2005-08-16: +# AIM supported, for sending notices, using CTCP TYPING 0. (Use the AIM patch from Hanji http://get.bitlbee.org/patches/) +# +# 2004-10-31: +# Sends typing notice to the bitlbee server when typing a message in irssi. bitlbee > 0.92 +# +# 2004-06-11: +# shows [typing: ] in &bitlbee with multiple users. +# +use strict; +use Irssi::TextUI; +use Data::Dumper; + +use vars qw($VERSION %IRSSI); + +$VERSION = '1.7.1'; +%IRSSI = ( + authors => 'Tijmen "timing" Ruizendaal, Matt "f0rked" Sparks', + contact => 'tijmen.ruizendaal@gmail.com, root@f0rked.com', + name => 'BitlBee_typing_notice', + description => '1. Adds an item to the status bar wich shows [typing] when someone is typing a message on the supported IM-networks 2. Sends typing notices to the supported IM networks (the other way arround). (For bitlbee 3.0+)', + license => 'GPLv2', + url => 'http://the-timing.nl/stuff/irssi-bitlbee, http://f0rked.com', + changed => '2010-08-09', +); + +my $bitlbee_server; # server object +my @control_channels; # mostly: &bitlbee, &facebook etc. +init(); + +sub init { # if script is loaded after connect + my @servers = Irssi::servers(); + foreach my $server(@servers) { + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + my @channels = $server->channels(); + foreach my $channel(@channels) { + if( $channel->{mode} =~ /C/ ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } + } + } + } +} +# if connect after script is loaded +Irssi::signal_add_last('event 005' => sub { + my( $server ) = @_; + if( $server->isupport('NETWORK') eq 'BitlBee' ){ + $bitlbee_server = $server; + } +}); +# if new control channel is synced after script is loaded +Irssi::signal_add_last('channel sync' => sub { + my( $channel ) = @_; + if( $channel->{mode} =~ /C/ && $channel->{server}->{tag} eq $bitlbee_server->{tag} ){ + push @control_channels, $channel->{name} unless (grep $_ eq $channel->{name}, @control_channels); + } +}); + +# How often to check if we are typing, or on msn, +# how long to keep the typing notice up, or check +# if the other user is still typing... +my $KEEP_TYPING_TIMEOUT = 1; +my $STOP_TYPING_TIMEOUT = 7; + +my %timer_tag; + +my %typing; +my %tag; +my $line; +my %out_typing; +my $lastkey; +my $keylog_active = 1; +my $command_char = Irssi::settings_get_str('cmdchars'); # mostly: / +my $to_char = Irssi::settings_get_str("completion_char"); # mostly: : + +sub event_ctcp_msg { + my ($server, $msg, $from, $address) = @_; + return if $server->{tag} ne $bitlbee_server->{tag}; + if ( my($type) = $msg =~ "TYPING ([0-9])" ){ + Irssi::signal_stop(); + if( $type == 0 ){ + unset_typing($from); + } elsif( $type == 1 ){ + $typing{$from}=1; + if( $address !~ /\@login\.oscar\.aol\.com/ and $address !~ /\@YAHOO/ and $address !~ /\@login\.icq\.com/ ){ + Irssi::timeout_remove($tag{$from}); + delete($tag{$from}); + $tag{$from}=Irssi::timeout_add_once($STOP_TYPING_TIMEOUT*1000,"unset_typing",$from); + } + redraw($from); + } elsif( $type == 2 ){ + stale_typing($from); + } + } +} + +sub unset_typing { + my($from,$no_redraw)=@_; + delete $typing{$from} if $typing{$from}; + Irssi::timeout_remove($tag{$from}); + delete($tag{$from}); + redraw($from) if !$no_redraw; +} + +sub stale_typing { + my($from)=@_; + $typing{$from}=2; + redraw($from); +} + +sub redraw { + my($from)=@_; + my $window = Irssi::active_win(); + my $name = $window->get_active_name(); + + # only redraw if current window equals to the typing person, is a control channel or if allwin is set + if( $from eq $name || (grep $_ eq $name, @control_channels) || Irssi::settings_get_bool("bitlbee_typing_allwin") ){ + Irssi::statusbar_items_redraw('typing_notice'); + } +} + +sub event_msg { + my ($server,$data,$from,$address,$target) = @_; + return if $server->{tag} ne $bitlbee_server->{tag}; + my $channel=Irssi::active_win()->get_active_name(); + unset_typing $from, "no redraw"; + unset_typing $channel; +} + +sub event_quit { + my $server = shift; + return if $server->{tag} ne $bitlbee_server->{tag}; + my $nick = shift; + unset_typing $nick; +} + +sub typing_notice { + my ($item, $get_size_only) = @_; + my $window = Irssi::active_win(); + my $channel = $window->get_active_name(); + + if (exists($typing{$channel})) { + my $append=$typing{$channel}==2 ? " (stale)" : ""; + $item->default_handler($get_size_only, "{sb typing$append}", 0, 1); + } else { + $item->default_handler($get_size_only, "", 0, 1); + Irssi::timeout_remove($tag{$channel}); + delete($tag{$channel}); + } + # we check for correct windows again, because the statusbar item is redrawn after window change too. + if( (grep $_ eq $channel, @control_channels) || Irssi::settings_get_bool("bitlbee_typing_allwin")) { + foreach my $key (keys(%typing)) { + $line .= " ".$key; + if ($typing{$key}==2) { $line .= " (stale)"; } + } + if ($line ne "") { + $item->default_handler($get_size_only, "{sb typing:$line}", 0, 1); + $line = ""; + } + } +} + +sub window_change { + Irssi::statusbar_items_redraw('typing_notice'); + my $win = !Irssi::active_win() ? undef : Irssi::active_win()->{active}; + if (ref $win && ($win->{server}->{tag} eq $bitlbee_server->{tag})) { + if (!$keylog_active) { + $keylog_active = 1; + Irssi::signal_add_last('gui key pressed', 'key_pressed'); + } + } else { + if ($keylog_active) { + $keylog_active = 0; + Irssi::signal_remove('gui key pressed', 'key_pressed'); + } + } +} + +sub key_pressed { + return if !Irssi::settings_get_bool("bitlbee_send_typing"); + my $key = shift; + if ($key != 9 && $key != 10 && $lastkey != 27 && $key != 27 + && $lastkey != 91 && $key != 126 && $key != 127) + { + my $server = Irssi::active_server(); + my $window = Irssi::active_win(); + my $nick = $window->get_active_name(); + + if ($server->{tag} eq $bitlbee_server->{tag} && $nick ne "(status)" && $nick ne "root") { + if( grep $_ eq $nick, @control_channels ){ # send typing if in control channel + my $input = Irssi::parse_special("\$L"); + my ($first_word) = split(/ /,$input); + if ($input !~ /^$command_char.*/ && $first_word =~ s/$to_char$//){ + send_typing($first_word); + } + } else { # or any other channels / query + my $input = Irssi::parse_special("\$L"); + if ($input !~ /^$command_char.*/ && length($input) > 0){ + send_typing($nick); + } + } + } + } + $lastkey = $key; +} + +sub out_empty { + my ($a) = @_; + my($nick,$tag)=@{$a}; + delete($out_typing{$nick}); + Irssi::timeout_remove($timer_tag{$nick}); + delete($timer_tag{$nick}); + $bitlbee_server->command("^CTCP $nick TYPING 0"); +} + +sub send_typing { + my $nick = shift; + if (!exists($out_typing{$nick}) || time - $out_typing{$nick} > $KEEP_TYPING_TIMEOUT) { + $bitlbee_server->command("^CTCP $nick TYPING 1"); + $out_typing{$nick} = time; + ### Reset 'stop-typing' timer + Irssi::timeout_remove($timer_tag{$nick}); + delete($timer_tag{$nick}); + + ### create new timer + $timer_tag{$nick} = Irssi::timeout_add_once($STOP_TYPING_TIMEOUT*1000, 'out_empty', ["$nick", $bitlbee_server->{tag}]); + } +} + +#README: Delete the old bitlbee_send_typing string from ~/.irssi/config. A boolean is better. + +sub db_typing { + print "Detected channels: "; + print Dumper(@control_channels); + print "Detected server tag: ".$bitlbee_server->{tag}; + print "Tag: ".Dumper(%tag); + print "Timer Tag: ".Dumper(%timer_tag); + print "Typing: ".Dumper(%typing); + print "Out Typing: ".Dumper(%out_typing); +} + +Irssi::command_bind('db_typing','db_typing'); + +Irssi::settings_add_bool("bitlbee","bitlbee_send_typing",1); +Irssi::settings_add_bool("bitlbee","bitlbee_typing_allwin",0); + +Irssi::signal_add("ctcp msg", "event_ctcp_msg"); +Irssi::signal_add("message private", "event_msg"); +Irssi::signal_add("message public", "event_msg"); +Irssi::signal_add("message quit", "event_quit"); +Irssi::signal_add_last('window changed', 'window_change'); +Irssi::signal_add_last('gui key pressed', 'key_pressed'); +Irssi::statusbar_item_register('typing_notice', undef, 'typing_notice'); +Irssi::statusbars_recreate_items(); diff --git a/.irssi/scripts/extaway.pl b/.irssi/scripts/extaway.pl new file mode 100644 index 0000000..78e8392 --- /dev/null +++ b/.irssi/scripts/extaway.pl @@ -0,0 +1,194 @@ +# Away Manager +# +# This script allows you to have different automated +# actions on away +# +# - sets your nick, using a base and a keyword +# - in example: Crazy_Away +# - insert an away reason +# - say on all channels that your away +# +# This is my first IRSSI script, but I'll try to make it +# better soon. +# If you have ideas to improve it, or make it more efficient, +# contact me at crazycat@c-p-f.org + +use Irssi; +use Irssi::Irc; +use strict; + +use vars qw($VERSION %IRSSI); + +$VERSION = '1.0'; +%IRSSI = ( + authors => 'CrazyCat', + contact => 'crazycat@c-p-f.org', + name => 'ExtAway', + description => 'Extended Away & Back programm', + license => 'GNU GPLv2 or later', + changed => '$Date: 2005/01/12 03:04:01$' +); + +my $xa_confile = Irssi::get_irssi_dir()."/xa.config"; +my %infos = (); +my ($oldnick, $t_away); + +sub init { + # verifying if settings file exists + if (!(open xa_settings, "<$xa_confile")) { + putlog("No config file: /xahelp for help"); + return 0; + }; + # reading the config file + while (my $line = ) { + $line =~ s/\n//; + my ($xa_key,$xa_val) = split(/:/, $line); + $xa_key =~ tr/[A-Z]/[a-z]/; + if ($xa_val ne "") { + $infos{$xa_key} = $xa_val; + } + } + close xa_settings; +} + +sub xa_go { + # Main procedure to go away + my($data,$server,$channel) = @_; + my $xa_nick = ""; + my $xa_reason = ""; + if ($server->{usermode_away}) { + # oooops! already marged as away + &putlog("You're allready marqued as away ($server->{away_reason})"); + return 0; + } + $oldnick = $server->{nick}; + $t_away = time(); + my $t_data = split(/ /, $data); + if ($t_data < 2) { + # away called with just a keyword + $xa_nick = $data; + $xa_nick =~ tr/[A-Z]/[a-z]/; + $xa_reason = $infos{$xa_nick}; + } else { + # this is a new reason + ($xa_nick, $xa_reason) = $data =~ /^(\S+) (.*)/; + &xa_add($xa_nick, $xa_reason); + } + if ($xa_reason eq "") { + putlog("Sorry, <$xa_nick> is not defined"); + } else { + my $nick = "$infos{'bnick'}$xa_nick"; + foreach my $server (Irssi::servers) { + $server->command("AWAY $xa_reason"); + $server->command("NICK $nick"); + foreach my $chan ($server->channels) { + $server->command("DESCRIBE $chan->{name} is away [Reason: $xa_reason]"); + } + } + } +} + +sub xa_back { + # the way to be back + my($data,$server,$channel) = @_; + if (!$server->{usermode_away}) { + &putlog("You're not marqued as away"); + return 0; + } + my $delay = time() - $t_away; + my $f_delay = f_delay($delay); + foreach my $server (Irssi::servers) { + foreach my $chan ($server->channels) { + $server->command("DESCRIBE $chan->{name} is back from [$server->{away_reason}] - $f_delay away"); + } + $server->command("AWAY"); + $server->command("NICK $oldnick"); + } +} + +sub putlog { + # procedure to write in status window + my ($window) = Irssi::active_win(); + Irssi::print("[$IRSSI{'name'}] @_", MSGLEVEL_CLIENTNOTICE); + +} + +sub f_delay { + # formatting the away time + my $seconds = shift; + my ($hours, $minutes, $formated); + if ($seconds > 3600) { + $hours = int($seconds / 3600); + $formated .= $hours."h:"; + $seconds = $seconds - ($hours * 3600); + } + if ($seconds > 60) { + $minutes = int($seconds / 60); + $formated .= $minutes."m:"; + $seconds = $seconds - ($minutes * 60); + } + $formated .= $seconds."s"; + return $formated; +} + +sub xa_add { + # Adding the keyword and the reason in the config file + # may create double entries... + my($kw, $reason) = @_; + if(!(open xa_settings, ">>$xa_confile")) { + &putlog("Unable to open file $xa_confile"); + } + print xa_settings "$kw:$reason\n"; + close xa_settings; + $infos{$kw} = $reason; +} + +sub xa_save { + # save the temp infos (might correct the double entries) + my ($data,$server,$channel) = @_; + if(!(open xa_settings, ">$xa_confile")) { + &putlog("Unable to create file $xa_confile"); + } + print xa_settings "bnick:$infos{'bnick'}\n"; + while (my ($kw, $line) = each %infos) { + if ($kw ne "bnick") { + print xa_settings "$kw:$infos{$kw}\n"; + } + } + close xa_settings; +} + +sub xa_nick { + # The way to add the base nick + my ($data,$server,$channel) = @_; + if ($data eq "") { + putlog("You must define your base_nick") + } + $infos{'bnick'} = $data; + &xa_save; +} + +sub xa_help { + &putlog("Help for $IRSSI{name} : $IRSSI{description}"); + &putlog(" Setting your base nick: /xanick "); + &putlog(" Going away: /aw [reason]"); + &putlog(" if keyword exists in the base, reason is automatically displayed"); + &putlog(" if keyword is a new one, you MUST give a reason"); + &putlog(" -- Nota: your away nick will be --"); + &putlog(" Coming back from away: /back"); + &putlog(" Saving all datas: /xasave (take care, setting your base_nick will save all your datas)"); +} +# +# main +# +&init(); +if ($infos{'bnick'} eq "") { + &putlog("Please, give a base nick with /xanick "); + &putlog("Use /xahelp to get some help"); +} +Irssi::command_bind("aw", "xa_go"); +Irssi::command_bind("back", "xa_back"); +Irssi::command_bind("xahelp", "xa_help"); +Irssi::command_bind("xanick", "xa_nick"); +Irssi::command_bind("xasave", "xa_save"); + diff --git a/.irssi/scripts/irccomplete.pl b/.irssi/scripts/irccomplete.pl new file mode 100644 index 0000000..bac2de1 --- /dev/null +++ b/.irssi/scripts/irccomplete.pl @@ -0,0 +1,210 @@ +# TAB complete words from dictionary +# for irssi 0.7.99 by Timo Sirainen +# Greatly modified by Erkki Seppälä to build dictionary of said words + +use Irssi; + +use vars qw($VERSION %IRSSI); +$VERSION = "0.1"; +%IRSSI = ( + authors => "Erkki Seppälä", + contact => "flux\@inside.org", + name => "IRC Completion", + description => "Adds words from IRC to your tab-completion list, plus fixes typos", + license => "Public Domain", + url => "http://xulfad.inside.org/~flux/software/irssi/", + changed => "Thu Feb 7 22:45:55 EET 2002" +); + + +my @wordHistory; +my %words; +my %permanent; + +my $wordChars = join("", ('a'..'z', '0'..'9', 'öä')); +my $maxWords = 5000; +my $minWordLength = 4; +my $maxWordLength = 80; +my $maxTypoLength = 10; +my $permanentThreshold = 1; + +my %typoWords; +my $correctWordCounter = 1; +my %correctWordsByIndex; +my %correctWordsByWord; + +# by word +sub addCorrectWord { + my $index = $correctWordsByWord{$_[0]} or 0; + if ($index > 0) { + ++$correctWordsByIndex{$index}->[1]; + return $index; + } else { + $correctWordsByIndex{$correctWordCounter} = [$_[0], 1]; + $correctWordsByWord{$_[0]} = $correctWordCounter; + ++$correctWordCounter; + return $correctWordCounter - 1; + } +}; + +# by word +sub delCorrectWord { + my ($word) = @_; + my $index = $correctWordsByWord{$word}; + if (--$correctWordsByIndex{$index}->[1] == 0) { + delete $correctWordsByWord{$correctWordsByIndex{$index}->[0]}; + delete $correctWordsByIndex{$index}; + } +} + +sub sig_complete { + my ($complist, $window, $word, $linestart, $want_space) = @_; + + $word =~ s/([^a-zA-Z0-9])/\\\1/g; + + @$complist = reverse (@$complist, grep(/^$word/, (keys %permanent, keys %words))); + + if (exists $typoWords{$word}) { + my $correctWord = $correctWordsByIndex{$typoWords{$word}->[0]}->[0]; + @$complist = (@complist, $correctWord); + } + + my %m = map { ($_ => $n++); } @$complist; + @$complist = (); + foreach my $key (sort keys %m) { + $m2{$m{$key}}=$key; + } + foreach my $key (reverse sort keys %m2) { + push @$complist, $m2{$key}; + } +} + +# $word, $removes +sub generate_drops { + my ($word, $changes) = @_; + my @list; + for (my $c = 0; $c < length($word) - 1; ++$c) { + my $misWord = substr($word, 0, $c) . substr($word, $c + 1); + if ($changes > 1) { + push @list, generate_drops($misWord, $changes - 1); + } else { + push @list, $misWord; + } + } + return @list; +} + +sub generate_translations { + my ($word, $changes) = @_; + my @list; + for (my $c = 1; $c < length($word); ++$c) { + my $misWord = substr($word, 0, $c - 1) . substr($word, $c, 1) . substr($word, $c - 1, 1) . substr($word, $c + 1); + if ($changes > 1) { + push @list, generate_drops($misWord, $changes - 1); + } else { + push @list, $misWord; + } + } + return @list; +} + +# $word +sub generate_typos { + my $maxTypoLength = Irssi::settings_get_int('irccomplete_maximum_typo_length'); + my ($word) = @_; + + if (length($word) > $maxTypoLength) { + return (); + } else { + return (generate_drops($word, 1), generate_translations($word)); + } +} + +sub sig_message { + my ($server, $message) = @_; + my $maxWords = Irssi::settings_get_int('irccomplete_words'); + my $minWordLength = Irssi::settings_get_int('irccomplete_minimum_length'); + my $maxWordLength = Irssi::settings_get_int('irccomplete_maximum_length'); + my $wordChars = Irssi::settings_get_str("irccomplete_word_characters"); + my $permanentThreshold = Irssi::settings_get_int('irccomplete_permanent_percent'); + foreach my $word (split(/[^$wordChars]/, $message)) { + if (length($word) >= $minWordLength && length($word) <= $maxWordLength) { + if (++$words{$word} > $permanentThreshold / 100.0 * $maxWords) { + if (++$permanent{$word} == 1) { + #Irssi::printformat(MSGLEVEL_CLIENTNOTICE, 'irccomplete_permanent', $word); + Irssi::print "Added $word to the list of permanent words"; + } + } + push @wordHistory, $word; + my $wordIndex = addCorrectWord($word); + foreach my $misword (generate_typos($word, 1)) { + if (!exists $typoWords{$misword}) { + $typoWords{$misword} = [$wordIndex, 1]; + } else { + ++$typoWords{$misword}->[1]; + } + } + while (@wordHistory > $maxWords) { + my $word = shift @wordHistory; + if (--$words{$word} == 0) { + delete $words{$word}; + } + foreach my $misword (generate_typos($word, 1)) { + if (--$typoWords{$misword}->[1] == 0) { + delete $typoWords{$misword}; + } + } + delCorrectWord($word); + } + } + } + + + return 1; +} + +sub cmd_typowords { + Irssi::print (scalar(@wordHistory) . " words, " . + scalar(keys %typoWords) . " typowords, " . + scalar(keys %correctWordsByWord) . "x" . scalar(keys %correctWordsByIndex) . " correct words"); + my $line = ""; + + foreach my $word (keys %typoWords) { + $line .= $word . "|" . $typoWords{$word}->[0] . " "; + } + Irssi::print "$line"; + $line = ""; + + foreach my $index (keys %correctWordsByIndex) { + $line .= $index . ":[" . join("|", @{$correctWordsByIndex{$index}}) . "] "; + } + Irssi::print "$line"; + $line = ""; + + foreach my $word (keys %correctWordsByWord) { + $line .= $word . ":" . $correctWordsByWord{$word} . " "; + } + Irssi::print "$line"; + $line = ""; + + return 1; +}; + +Irssi::theme_register(['irccomplete_permanent', 'Added $1 to the list of permanent words']); + +Irssi::settings_add_str("misc", "irccomplete_word_characters", $wordChars); +Irssi::settings_add_int("misc", "irccomplete_words", $maxWords); +Irssi::settings_add_int("misc", "irccomplete_minimum_length", $minWordLength); +Irssi::settings_add_int("misc", "irccomplete_maximum_length", $maxWordLength); +Irssi::settings_add_int("misc", "irccomplete_maximum_typo_length", $maxTypoLength); +Irssi::settings_add_int("misc", "irccomplete_permanent_percent", $permanentThreshold); + +foreach my $sig ("message public", "message private", + "message own_public", "message own_private", + "message topic") { +#foreach my $sig ("message own_public", "message own_private") { + Irssi::signal_add($sig, "sig_message"); +} +Irssi::signal_add_last('complete word', 'sig_complete'); + +Irssi::command_bind("irccomplete_typowords", "cmd_typowords"); diff --git a/.irssi/scripts/lastfm.pl b/.irssi/scripts/lastfm.pl new file mode 100644 index 0000000..4ff2105 --- /dev/null +++ b/.irssi/scripts/lastfm.pl @@ -0,0 +1,447 @@ +# vim: set expandtab: +use vars qw($VERSION %IRSSI); +$VERSION = "5.8"; +%IRSSI = ( + authors => "Simon 'simmel' Lundström", + contact => 'simmel@(freenode|quakenet|efnet) http://last.fm/user/darksoy', + name => "lastfm", + date => "20110125", + description => 'A now-playing-script which uses Last.fm', + license => "BSD", + url => "http://soy.se/code/", +); +# USAGE +# For details on how to use each setting, scroll down to the SETTINGS section. + +# QUICK START +# * First of all, you need the libwww/LWP package installed. The package in +# your package system is probably called something with libwww and perl and/or +# p5 in it. +# * /set lastfm_user to the username that you are using on Last.fm +# * Show with /np or %np what song "lastfm_user" last scrobbled to Last.fm via /say. If "lastfm_use_action" is set, it uses /me. +# * To see what another user on Last.fm is playing is also possible via /np or %np(). +# The now-playing message is configurable via via "lastfm_output" (and lastfm_output_tab_complete when using %np, if not set it will use lastfm_output by default.). "lastfm_strftime" can be used to configure the display of date and time when the song was scrobbled. + +# SETTINGS +# NOTE: Do not set these options here, use /set