9 $Data::Dumper::Indent = 1;
12 $ENV{JSON_ANY_ORDER} = "JSON Syck DWIW";
19 use vars qw($VERSION %IRSSI);
22 my ($REV) = '$Rev: 352 $' =~ /(\d+)/;
24 authors => 'Dan Boger',
25 contact => 'zigdon@gmail.com',
27 description => 'Send twitter updates using /tweet. '
28 . 'Can optionally set your bitlbee /away message to same',
29 license => 'GNU GPL v2',
30 url => 'http://tinyurl.com/twirssi',
31 changed => '$Date: 2009-01-08 13:46:50 -0800 (Thu, 08 Jan 2009) $',
41 my $last_poll = time - 300;
46 my ( $data, $server, $win ) = @_;
49 ¬ice("Not logged in! Use /twitter_login username pass!");
53 my ( $target, $text ) = split ' ', $data, 2;
54 unless ( $target and $text ) {
55 ¬ice("Usage: /dm <nick> <message>");
59 &cmd_direct_as( "$user $data", $server, $win );
63 my ( $data, $server, $win ) = @_;
66 ¬ice("Not logged in! Use /twitter_login username pass!");
70 my ( $username, $target, $text ) = split ' ', $data, 3;
71 unless ( $username and $target and $text ) {
72 ¬ice("Usage: /dm_as <username> <nick> <message>");
76 unless ( exists $twits{$username} ) {
77 ¬ice("Unknown username $username");
82 unless ( $twits{$username}
83 ->new_direct_message( { user => $target, text => $text } ) )
85 ¬ice("DM to $target failed");
91 ¬ice("DM caused an error. Aborted");
95 ¬ice("DM sent to $target");
96 $nicks{$target} = time;
100 my ( $data, $server, $win ) = @_;
103 ¬ice("Not logged in! Use /twitter_login username pass!");
107 $data =~ s/^\s+|\s+$//;
109 ¬ice("Usage: /tweet <update>");
113 &cmd_tweet_as( "$user $data", $server, $win );
117 my ( $data, $server, $win ) = @_;
120 ¬ice("Not logged in! Use /twitter_login username pass!");
124 $data =~ s/^\s+|\s+$//;
125 my ( $username, $data ) = split ' ', $data, 2;
127 unless ( $username and $data ) {
128 ¬ice("Usage: /tweet_as <username> <update>");
132 unless ( exists $twits{$username} ) {
133 ¬ice("Unknown username $username");
137 if ( Irssi::settings_get_str("short_url_provider") ) {
138 foreach my $url ( $data =~ /(https?:\/\/\S+[\w\/])/g ) {
140 my $short = makeashorterlink($url);
141 $data =~ s/\Q$url/$short/g;
146 if ( length $data > 140 ) {
148 "Tweet too long (" . length($data) . " characters) - aborted" );
153 unless ( $twits{$username}->update($data) )
155 ¬ice("Update failed");
161 ¬ice("Update caused an error. Aborted.");
165 foreach ( $data =~ /@([-\w]+)/ ) {
170 if ( Irssi::settings_get_bool("tweet_to_away")
172 and $data !~ /^[dD] / )
175 Irssi::server_find_tag( Irssi::settings_get_str("bitlbee_server") );
177 $server->send_raw("away :$data");
180 ¬ice( "Can't find bitlbee server.",
181 "Update bitlbee_server or disable tweet_to_away" );
185 ¬ice( "Update sent" . ( $away ? " (and away msg set)" : "" ) );
189 my ( $data, $server, $win ) = @_;
192 ¬ice("Not logged in! Use /twitter_login username pass!");
196 $data =~ s/^\s+|\s+$//;
198 ¬ice("Usage: /reply <nick[:num]> <update>");
202 $data =~ s/^\s+|\s+$//;
203 my ( $id, $data ) = split ' ', $data, 2;
204 unless ( $id and $data ) {
205 ¬ice("Usage: /reply_as <nick[:num]> <update>");
209 &cmd_reply_as( "$user $id $data", $server, $win );
213 my ( $data, $server, $win ) = @_;
215 unless ( Irssi::settings_get_bool("twirssi_track_replies") ) {
216 ¬ice("twirssi_track_replies is required in order to reply to "
217 . "specific tweets. Either enable it, or just use /tweet "
218 . "\@username <text>." );
223 ¬ice("Not logged in! Use /twitter_login username pass!");
227 $data =~ s/^\s+|\s+$//;
228 my ( $username, $id, $data ) = split ' ', $data, 3;
230 unless ( $username and $data ) {
231 ¬ice("Usage: /reply_as <username> <nick[:num]> <update>");
235 unless ( exists $twits{$username} ) {
236 ¬ice("Unknown username $username");
241 $id =~ s/[^\w\d\-:]+//g;
242 ( $nick, $id ) = split /:/, $id;
243 unless ( exists $id_map{ lc $nick } ) {
244 ¬ice("Can't find a tweet from $nick to reply to!");
248 $id = $id_map{__indexes}{$nick} unless $id;
249 unless ( $id_map{ lc $nick }[$id] ) {
250 ¬ice("Can't find a tweet numbered $id from $nick to reply to!");
254 # remove any @nick at the beginning of the reply, as we'll add it anyway
255 $data =~ s/^\s*\@?$nick\s*//;
256 $data = "\@$nick " . $data;
258 if ( Irssi::settings_get_str("short_url_provider") ) {
259 foreach my $url ( $data =~ /(https?:\/\/\S+[\w\/])/g ) {
261 my $short = makeashorterlink($url);
262 $data =~ s/\Q$url/$short/g;
267 if ( length $data > 140 ) {
269 "Tweet too long (" . length($data) . " characters) - aborted" );
275 $twits{$username}->update(
278 in_reply_to_status_id => $id_map{ lc $nick }[$id]
283 ¬ice("Update failed");
289 ¬ice("Update caused an error. Aborted");
293 foreach ( $data =~ /@([-\w]+)/ ) {
298 if ( Irssi::settings_get_bool("tweet_to_away")
300 and $data !~ /^[dD] / )
303 Irssi::server_find_tag( Irssi::settings_get_str("bitlbee_server") );
305 $server->send_raw("away :$data");
308 ¬ice( "Can't find bitlbee server.",
309 "Update bitlbee_server or disalbe tweet_to_away" );
313 ¬ice( "Update sent" . ( $away ? " (and away msg set)" : "" ) );
317 my ( $usage_str, $api_name, $post_ref ) = @_;
320 my ( $data, $server, $win ) = @_;
323 ¬ice("Not logged in! Use /twitter_login username pass!");
327 $data =~ s/^\s+|\s+$//;
329 ¬ice("Usage: $usage_str");
334 unless ( $twit->$api_name($data) )
336 ¬ice("$api_name failed");
342 ¬ice("$api_name caused an error. Aborted.");
346 &$post_ref($data) if $post_ref;
351 my ( $data, $server, $win ) = @_;
353 $data =~ s/^\s+|\s+$//g;
354 if ( exists $twits{$data} ) {
355 ¬ice("Switching to $data");
356 $twit = $twits{$data};
359 ¬ice("Unknown user $data");
364 my ( $data, $server, $win ) = @_;
366 $data =~ s/^\s+|\s+$//g;
367 if ( $data and exists $twits{$data} ) {
368 ¬ice("Logging out $data...");
369 $twits{$data}->end_session();
370 delete $twits{$data};
372 ¬ice("Unknown username '$data'");
374 ¬ice("Logging out $user...");
375 $twit->end_session();
377 delete $twits{$user};
379 &cmd_switch( ( keys %twits )[0], $server, $win );
381 Irssi::timeout_remove($poll) if $poll;
388 my ( $data, $server, $win ) = @_;
391 ( $user, $pass ) = split ' ', $data, 2;
392 } elsif ( my $autouser = Irssi::settings_get_str("twitter_usernames")
393 and my $autopass = Irssi::settings_get_str("twitter_passwords") )
395 my @user = split /\s*,\s*/, $autouser;
396 my @pass = split /\s*,\s*/, $autopass;
397 if ( @user != @pass ) {
398 ¬ice("Number of usernames doesn't match "
399 . "the number of passwords - auto-login failed" );
402 while ( @user and @pass ) {
410 ¬ice("/twitter_login requires either a username and password "
411 . "or twitter_usernames and twitter_passwords to be set." );
415 %friends = %nicks = ();
417 $twit = Net::Twitter->new(
423 unless ( $twit->verify_credentials() ) {
424 ¬ice("Login as $user failed");
427 &cmd_switch( ( keys %twits )[0], $server, $win );
433 my $rate_limit = $twit->rate_limit_status();
434 if ( $rate_limit and $rate_limit->{remaining_hits} < 1 ) {
435 ¬ice("Rate limit exceeded, try again later");
440 $twits{$user} = $twit;
441 Irssi::timeout_remove($poll) if $poll;
442 $poll = Irssi::timeout_add( 300 * 1000, \&get_updates, "" );
443 ¬ice("Logged in as $user, loading friends list...");
445 ¬ice( "loaded friends: ", scalar keys %friends );
446 if ( Irssi::settings_get_bool("twirssi_first_run") ) {
447 Irssi::settings_set_bool( "twirssi_first_run", 0 );
448 unless ( exists $friends{twirssi} ) {
449 ¬ice("Welcome to twirssi!"
450 . " Perhaps you should add \@twirssi to your friends list,"
451 . " so you can be notified when a new version is release?"
452 . " Just type /twitter_friend twirssi." );
459 ¬ice("Login failed");
464 my ( $data, $server, $win ) = @_;
466 my $loc = Irssi::settings_get_str("twirssi_location");
469 "$loc isn't writable, can't upgrade. Perhaps you need to /set twirssi_location?"
474 if ( not -x "/usr/bin/md5sum" and not $data ) {
476 "/usr/bin/md5sum can't be found - try '/twirssi_upgrade nomd5' to skip MD5 verification"
483 eval { use Digest::MD5; };
487 "Failed to load Digest::MD5. Try '/twirssi_upgrade nomd5' to skip MD5 verification"
492 $md5 = get("http://twirssi.com/md5sum");
496 ¬ice("Failed to download md5sum from peeron! Aborting.");
500 unless ( open( CUR, $loc ) ) {
502 "Failed to read $loc. Check that /set twirssi_location is set to the correct location."
507 my $cur_md5 = Digest::MD5::md5_hex(<CUR>);
510 if ( $cur_md5 eq $md5 ) {
511 ¬ice("Current twirssi seems to be up to date.");
516 my $URL = "http://twirssi.com/twirssi.pl";
517 ¬ice("Downloading twirssi from $URL");
518 LWP::Simple::getstore( $URL, "$loc.upgrade" );
521 unless ( open( NEW, "$loc.upgrade" ) ) {
523 "Failed to read $loc.upgrade. Check that /set twirssi_location is set to the correct location."
528 my $new_md5 = Digest::MD5::md5_hex(<NEW>);
531 if ( $new_md5 ne $md5 ) {
532 ¬ice("MD5 verification failed. expected $md5, got $new_md5");
537 rename $loc, "$loc.backup"
538 or ¬ice("Failed to back up $loc: $!. Aborting")
540 rename "$loc.upgrade", $loc
541 or ¬ice("Failed to rename $loc.upgrade: $!. Aborting")
544 my ( $dir, $file ) = ( $loc =~ m{(.*)/([^/]+)$} );
545 if ( -e "$dir/autorun/$file" ) {
546 ¬ice("Updating $dir/autorun/$file");
547 unlink "$dir/autorun/$file"
548 or ¬ice("Failed to remove old $file from autorun: $!");
549 symlink "../$file", "$dir/autorun/$file"
550 or ¬ice("Failed to create symlink in autorun directory: $!");
553 ¬ice("Download complete. Reload twirssi with /script load $file");
563 print $fh "type:debug Loading friends page $page...\n"
564 if ( $fh and &debug );
565 my $friends = $twit->friends( { page => $page } );
566 last unless $friends;
567 $new_friends{ $_->{screen_name} } = time foreach @$friends;
569 last if @$friends == 0 or $page == 10;
574 print $fh "type:debug Error during friends list update. Aborted.\n";
578 my ( $added, $removed ) = ( 0, 0 );
579 print $fh "type:debug Scanning for new friends...\n" if ( $fh and &debug );
580 foreach ( keys %new_friends ) {
581 next if exists $friends{$_};
586 print $fh "type:debug Scanning for removed friends...\n"
587 if ( $fh and &debug );
588 foreach ( keys %friends ) {
589 next if exists $new_friends{$_};
594 return ( $added, $removed );
598 print scalar localtime, " - get_updates starting" if &debug;
601 Irssi::window_find_name( Irssi::settings_get_str('twitter_window') );
604 ->print( "Can't find a window named '"
605 . Irssi::settings_get_str('twitter_window')
606 . "'. Create it or change the value of twitter_window" );
609 ¬ice("Not logged in! Use /twitter_login username pass!");
613 my ( $fh, $filename ) = File::Temp::tempfile();
617 Irssi::timeout_add_once( 5000, 'monitor_child', [ $filename, 0 ] );
618 Irssi::pidwait_add($pid);
619 } elsif ( defined $pid ) { # child
627 $error += &do_updates( $fh, $user, $twit );
628 foreach ( keys %twits ) {
630 $error += &do_updates( $fh, $_, $twits{$_} );
633 my ( $added, $removed ) = &load_friends($fh);
634 if ( $added + $removed ) {
635 print $fh "type:debug %R***%n Friends list updated: ",
637 sprintf( "%d added", $added ),
638 sprintf( "%d removed", $removed ) ),
641 print $fh "__friends__\n";
642 foreach ( sort keys %friends ) {
643 print $fh "$_ $friends{$_}\n";
647 print $fh "type:debug Update encountered errors. Aborted\n";
648 print $fh $last_poll;
655 print scalar localtime, " - get_updates ends" if &debug;
659 my ( $fh, $username, $obj ) = @_;
661 print scalar localtime, " - Polling for updates for $username" if &debug;
664 $tweets = $obj->friends_timeline(
665 { since => HTTP::Date::time2str($last_poll) } );
669 print $fh "type:debug Error during friends_timeline call. Aborted.\n";
673 unless ( ref $tweets ) {
674 if ( $obj->can("get_error") ) {
675 print $fh "type:debug API Error during friends_timeline call: ",
676 JSON::Any->jsonToObj( $obj->get_error() ), " Aborted.\n";
679 "type:debug API Error during friends_timeline call. Aborted.\n";
684 foreach my $t ( reverse @$tweets ) {
685 my $text = decode_entities( $t->{text} );
687 $text =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
689 if ( Irssi::settings_get_bool("show_reply_context")
690 and $t->{in_reply_to_screen_name} ne $username
691 and $t->{in_reply_to_screen_name}
692 and not exists $friends{ $t->{in_reply_to_screen_name} } )
694 $nicks{ $t->{in_reply_to_screen_name} } = time;
697 $context = $obj->show_status( $t->{in_reply_to_status_id} );
701 my $ctext = decode_entities( $context->{text} );
703 $ctext =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
704 printf $fh "id:%d account:%s nick:%s type:tweet %s\n",
705 $context->{id}, $username,
706 $context->{user}{screen_name}, $ctext;
709 print $fh "type:debug request to get context failed: $@";
711 print $fh "type:debug Failed to get context from $t->{in_reply_to_screen_name}"
716 if $t->{user}{screen_name} eq $username
717 and not Irssi::settings_get_bool("show_own_tweets");
718 printf $fh "id:%d account:%s nick:%s type:%s %s\n",
719 $t->{id}, $username, $t->{user}{screen_name}, $reply, $text;
722 print scalar localtime, " - Polling for replies" if &debug;
724 $tweets = $obj->replies( { since => HTTP::Date::time2str($last_poll) } )
729 print $fh "type:debug Error during replies call. Aborted.\n";
733 foreach my $t ( reverse @$tweets ) {
735 if exists $friends{ $t->{user}{screen_name} };
737 my $text = decode_entities( $t->{text} );
739 $text =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
740 printf $fh "id:%d account:%s nick:%s type:tweet %s\n",
741 $t->{id}, $username, $t->{user}{screen_name}, $text;
744 print scalar localtime, " - Polling for DMs" if &debug;
747 $obj->direct_messages( { since => HTTP::Date::time2str($last_poll) } )
752 print $fh "type:debug Error during direct_messages call. Aborted.\n";
756 foreach my $t ( reverse @$tweets ) {
757 my $text = decode_entities( $t->{text} );
759 $text =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
760 printf $fh "id:%d account:%s nick:%s type:dm %s\n",
761 $t->{id}, $username, $t->{sender_screen_name}, $text;
763 print scalar localtime, " - Done" if &debug;
770 my $filename = $data->[0];
771 my $attempt = $data->[1];
773 print scalar localtime, " - checking child log at $filename ($attempt)"
776 if ( open FILE, $filename ) {
780 last if /^__friends__/;
782 foreach my $key (qw/id account nick type/) {
783 if (s/^$key:(\S+)\s*//) {
788 next if exists $meta{id} and exists $tweet_cache{ $meta{id} };
789 $tweet_cache{ $meta{id} } = time;
791 if ( $meta{account} ne $user ) {
792 $account = "$meta{account}: ";
796 if ( $meta{type} ne 'dm'
797 and Irssi::settings_get_bool("twirssi_track_replies")
801 $marker = ( $id_map{__indexes}{ $meta{nick} } + 1 ) % 100;
802 $id_map{ lc $meta{nick} }[$marker] = $meta{id};
803 $id_map{__indexes}{ $meta{nick} } = $marker;
804 $marker = ":$marker";
807 if ( $meta{type} eq 'tweet' ) {
808 push @lines, "[$account%B\@$meta{nick}%n$marker] $_\n",;
809 } elsif ( $meta{type} eq 'reply' ) {
810 push @lines, "[$account\\--> %B\@$meta{nick}%n$marker] $_\n",;
811 } elsif ( $meta{type} eq 'dm' ) {
812 push @lines, "[$account%B\@$meta{nick}%n (%WDM%n)] $_\n",;
813 } elsif ( $meta{type} eq 'error' ) {
814 push @lines, "ERROR: $_\n";
815 } elsif ( $meta{type} eq 'debug' ) {
816 print "$_" if &debug,;
818 print "Unknown line type $meta{type}: $_" if &debug,;
828 my ( $f, $t ) = split ' ', $_;
829 $nicks{$f} = $friends{$f} = $t;
832 if ($new_last_poll) {
833 print "new last_poll = $new_last_poll" if &debug;
834 foreach my $line (@lines) {
836 $window->print( $line, MSGLEVEL_PUBLIC );
837 foreach ( $line =~ /\@([-\w]+)/ ) {
844 or warn "Failed to remove $filename: $!"
847 # keep enough cached tweets, to make sure we don't show duplicates.
848 foreach ( keys %tweet_cache ) {
849 next if $tweet_cache{$_} >= $last_poll;
850 delete $tweet_cache{$_};
852 $last_poll = $new_last_poll;
857 Irssi::settings_get_str("twirssi_replies_store") )
859 if ( open JSON, ">$file" ) {
860 print JSON JSON::Any->objToJson( \%id_map );
863 ¬ice("Failed to write replies to $file: $!");
872 if ( $attempt < 12 ) {
873 Irssi::timeout_add_once( 5000, 'monitor_child',
874 [ $filename, $attempt + 1 ] );
876 ¬ice("Giving up on polling $filename");
877 unlink $filename unless &debug;
882 return Irssi::settings_get_bool("twirssi_debug");
886 $window->print( "%R***%n @_", MSGLEVEL_PUBLIC );
890 my ( $complist, $window, $word, $linestart, $want_space ) = @_;
893 $linestart =~ /^\/twitter_reply(?:_as)?\s*$/
894 or ( Irssi::settings_get_bool("twirssi_use_reply_aliases")
895 and $linestart =~ /^\/reply(?:_as)?\s*$/ )
897 { # /twitter_reply gets a nick:num
898 @$complist = grep /^\Q$word/i, sort keys %{ $id_map{__indexes} };
901 # /tweet, /tweet_as, /dm, /dm_as - complete @nicks (and nicks as the first
903 if ( $linestart =~ /^\/(?:tweet|dm)/ ) {
904 my $prefix = $word =~ s/^@//;
905 $prefix = 0 if $linestart eq '/dm' or $linestart eq '/dm_as';
906 push @$complist, grep /^\Q$word/i,
907 sort { $nicks{$b} <=> $nicks{$a} } keys %nicks;
908 @$complist = map { "\@$_" } @$complist if $prefix;
912 Irssi::settings_add_str( "twirssi", "twitter_window", "twitter" );
913 Irssi::settings_add_str( "twirssi", "bitlbee_server", "bitlbee" );
914 Irssi::settings_add_str( "twirssi", "short_url_provider", "TinyURL" );
915 Irssi::settings_add_str( "twirssi", "twirssi_location",
916 ".irssi/scripts/twirssi.pl" );
917 Irssi::settings_add_str( "twirssi", "twitter_usernames", undef );
918 Irssi::settings_add_str( "twirssi", "twitter_passwords", undef );
919 Irssi::settings_add_str( "twirssi", "twirssi_replies_store",
920 ".irssi/scripts/twirssi.json" );
921 Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 );
922 Irssi::settings_add_bool( "twirssi", "show_reply_context", 0 );
923 Irssi::settings_add_bool( "twirssi", "show_own_tweets", 1 );
924 Irssi::settings_add_bool( "twirssi", "twirssi_debug", 0 );
925 Irssi::settings_add_bool( "twirssi", "twirssi_first_run", 1 );
926 Irssi::settings_add_bool( "twirssi", "twirssi_track_replies", 1 );
927 Irssi::settings_add_bool( "twirssi", "twirssi_use_reply_aliases", 0 );
928 $window = Irssi::window_find_name( Irssi::settings_get_str('twitter_window') );
931 Irssi::command_bind( "dm", "cmd_direct" );
932 Irssi::command_bind( "dm_as", "cmd_direct_as" );
933 Irssi::command_bind( "tweet", "cmd_tweet" );
934 Irssi::command_bind( "tweet_as", "cmd_tweet_as" );
935 Irssi::command_bind( "twitter_reply", "cmd_reply" );
936 Irssi::command_bind( "twitter_reply_as", "cmd_reply_as" );
937 Irssi::command_bind( "twitter_login", "cmd_login" );
938 Irssi::command_bind( "twitter_logout", "cmd_logout" );
939 Irssi::command_bind( "twitter_switch", "cmd_switch" );
940 Irssi::command_bind( "twirssi_upgrade", "cmd_upgrade" );
941 if ( Irssi::settings_get_bool("twirssi_use_reply_aliases") ) {
942 Irssi::command_bind( "reply", "cmd_reply" );
943 Irssi::command_bind( "reply_as", "cmd_reply_as" );
948 print "twits: ", join ", ",
949 map { "u: $_->{username}" } values %twits;
950 print "friends: ", join ", ", sort keys %friends;
951 print "nicks: ", join ", ", sort keys %nicks;
952 print "id_map: ", Dumper \%{ $id_map{__indexes} };
953 print "last poll: $last_poll";
959 ¬ice("Twirssi v$VERSION (r$REV); "
960 . "Net::Twitter v$Net::Twitter::VERSION. "
962 . JSON::Any::handler()
963 . ". See details at http://twirssi.com/" );
969 "/twitter_friend <username>",
971 sub { ¬ice("Following $_[0]"); $nicks{ $_[0] } = time; }
977 "/twitter_unfriend <username>",
979 sub { ¬ice("Stopped following $_[0]"); delete $nicks{ $_[0] }; }
982 Irssi::command_bind( "twitter_updates", "get_updates" );
983 Irssi::signal_add_last( 'complete word' => \&sig_complete );
985 ¬ice(" %Y<%C(%B^%C)%N TWIRSSI v%R$VERSION%N (r$REV)");
986 ¬ice(" %C(_(\\%N http://twirssi.com/ for full docs");
988 " %Y||%C `%N Log in with /twitter_login, send updates with /tweet");
990 my $file = Irssi::settings_get_str("twirssi_replies_store");
991 if ( $file and -r $file ) {
992 if ( open( JSON, $file ) ) {
997 my $ref = JSON::Any->jsonToObj($json);
999 my $num = keys %{ $id_map{__indexes} };
1000 ¬ice( sprintf "Loaded old replies from %d contact%s.",
1001 $num, ( $num == 1 ? "" : "s" ) );
1004 ¬ice("Failed to load old replies from $file: $!");
1008 if ( my $provider = Irssi::settings_get_str("short_url_provider") ) {
1009 eval "use WWW::Shorten::$provider;";
1013 "Failed to load WWW::Shorten::$provider - either clear short_url_provider or install the CPAN module"
1018 if ( my $autouser = Irssi::settings_get_str("twitter_usernames")
1019 and my $autopass = Irssi::settings_get_str("twitter_passwords") )
1026 ->print( "Create a window named "
1027 . Irssi::settings_get_str('twitter_window')
1028 . " or change the value of twitter_window. Then, reload twirssi." );