9 $Data::Dumper::Indent = 1;
12 $ENV{JSON_ANY_ORDER} = "JSON Syck DWIW";
19 use vars qw($VERSION %IRSSI);
22 my ($REV) = '$Rev: 351 $' =~ /(\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-06 19:33:41 -0800 (Tue, 06 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:error 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:error 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:error Error during friends_timeline call. Aborted.\n";
673 unless ( ref $tweets ) {
674 if ( $obj->can("get_error") ) {
675 print $fh "type:error API Error during friends_timeline call: ",
676 JSON::Any->jsonToObj( $obj->get_error() ), " Aborted.\n";
679 "type:error 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;
695 my $context = $obj->show_status( $t->{in_reply_to_status_id} );
697 my $ctext = decode_entities( $context->{text} );
699 $ctext =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
700 printf $fh "id:%d account:%s nick:%s type:tweet %s\n",
701 $context->{id}, $username,
702 $context->{user}{screen_name}, $ctext;
705 print "Failed to get context from $t->{in_reply_to_screen_name}"
710 if $t->{user}{screen_name} eq $username
711 and not Irssi::settings_get_bool("show_own_tweets");
712 printf $fh "id:%d account:%s nick:%s type:%s %s\n",
713 $t->{id}, $username, $t->{user}{screen_name}, $reply, $text;
716 print scalar localtime, " - Polling for replies" if &debug;
718 $tweets = $obj->replies( { since => HTTP::Date::time2str($last_poll) } )
723 print $fh "type:error Error during replies call. Aborted.\n";
727 foreach my $t ( reverse @$tweets ) {
729 if exists $friends{ $t->{user}{screen_name} };
731 my $text = decode_entities( $t->{text} );
733 $text =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
734 printf $fh "id:%d account:%s nick:%s type:tweet %s\n",
735 $t->{id}, $username, $t->{user}{screen_name}, $text;
738 print scalar localtime, " - Polling for DMs" if &debug;
741 $obj->direct_messages( { since => HTTP::Date::time2str($last_poll) } )
746 print $fh "type:error Error during direct_messages call. Aborted.\n";
750 foreach my $t ( reverse @$tweets ) {
751 my $text = decode_entities( $t->{text} );
753 $text =~ s/(^|\W)\@([-\w]+)/$1%B\@$2%n/g;
754 printf $fh "id:%d account:%s nick:%s type:dm %s\n",
755 $t->{id}, $username, $t->{sender_screen_name}, $text;
757 print scalar localtime, " - Done" if &debug;
764 my $filename = $data->[0];
765 my $attempt = $data->[1];
767 print scalar localtime, " - checking child log at $filename ($attempt)"
770 if ( open FILE, $filename ) {
774 last if /^__friends__/;
776 foreach my $key (qw/id account nick type/) {
777 if (s/^$key:(\S+)\s*//) {
782 next if exists $meta{id} and exists $tweet_cache{ $meta{id} };
783 $tweet_cache{ $meta{id} } = time;
785 if ( $meta{account} ne $user ) {
786 $account = "$meta{account}: ";
790 if ( $meta{type} ne 'dm'
791 and Irssi::settings_get_bool("twirssi_track_replies")
795 $marker = ( $id_map{__indexes}{ $meta{nick} } + 1 ) % 100;
796 $id_map{ lc $meta{nick} }[$marker] = $meta{id};
797 $id_map{__indexes}{ $meta{nick} } = $marker;
798 $marker = ":$marker";
801 if ( $meta{type} eq 'tweet' ) {
802 push @lines, "[$account%B\@$meta{nick}%n$marker] $_\n",;
803 } elsif ( $meta{type} eq 'reply' ) {
804 push @lines, "[$account\\--> %B\@$meta{nick}%n$marker] $_\n",;
805 } elsif ( $meta{type} eq 'dm' ) {
806 push @lines, "[$account%B\@$meta{nick}%n (%WDM%n)] $_\n",;
807 } elsif ( $meta{type} eq 'error' ) {
808 push @lines, "ERROR: $_\n";
809 } elsif ( $meta{type} eq 'debug' ) {
810 print "$_" if &debug,;
812 print "Unknown line type $meta{type}: $_" if &debug,;
822 my ( $f, $t ) = split ' ', $_;
823 $nicks{$f} = $friends{$f} = $t;
826 if ($new_last_poll) {
827 print "new last_poll = $new_last_poll" if &debug;
828 foreach my $line (@lines) {
830 $window->print( $line, MSGLEVEL_PUBLIC );
831 foreach ( $line =~ /\@([-\w]+)/ ) {
838 or warn "Failed to remove $filename: $!"
841 # keep enough cached tweets, to make sure we don't show duplicates.
842 foreach ( keys %tweet_cache ) {
843 next if $tweet_cache{$_} >= $last_poll;
844 delete $tweet_cache{$_};
846 $last_poll = $new_last_poll;
851 Irssi::settings_get_str("twirssi_replies_store") )
853 if ( open JSON, ">$file" ) {
854 print JSON JSON::Any->objToJson( \%id_map );
857 ¬ice("Failed to write replies to $file: $!");
866 if ( $attempt < 12 ) {
867 Irssi::timeout_add_once( 5000, 'monitor_child',
868 [ $filename, $attempt + 1 ] );
870 ¬ice("Giving up on polling $filename");
871 unlink $filename unless &debug;
876 return Irssi::settings_get_bool("twirssi_debug");
880 $window->print( "%R***%n @_", MSGLEVEL_PUBLIC );
884 my ( $complist, $window, $word, $linestart, $want_space ) = @_;
887 $linestart =~ /^\/twitter_reply(?:_as)?\s*$/
888 or ( Irssi::settings_get_bool("twirssi_use_reply_aliases")
889 and $linestart =~ /^\/reply(?:_as)?\s*$/ )
891 { # /twitter_reply gets a nick:num
892 @$complist = grep /^\Q$word/i, sort keys %{ $id_map{__indexes} };
895 # /tweet, /tweet_as, /dm, /dm_as - complete @nicks (and nicks as the first
897 if ( $linestart =~ /^\/(?:tweet|dm)/ ) {
898 my $prefix = $word =~ s/^@//;
899 $prefix = 0 if $linestart eq '/dm' or $linestart eq '/dm_as';
900 push @$complist, grep /^\Q$word/i,
901 sort { $nicks{$b} <=> $nicks{$a} } keys %nicks;
902 @$complist = map { "\@$_" } @$complist if $prefix;
906 Irssi::settings_add_str( "twirssi", "twitter_window", "twitter" );
907 Irssi::settings_add_str( "twirssi", "bitlbee_server", "bitlbee" );
908 Irssi::settings_add_str( "twirssi", "short_url_provider", "TinyURL" );
909 Irssi::settings_add_str( "twirssi", "twirssi_location",
910 ".irssi/scripts/twirssi.pl" );
911 Irssi::settings_add_str( "twirssi", "twitter_usernames", undef );
912 Irssi::settings_add_str( "twirssi", "twitter_passwords", undef );
913 Irssi::settings_add_str( "twirssi", "twirssi_replies_store",
914 ".irssi/scripts/twirssi.json" );
915 Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 );
916 Irssi::settings_add_bool( "twirssi", "show_reply_context", 0 );
917 Irssi::settings_add_bool( "twirssi", "show_own_tweets", 1 );
918 Irssi::settings_add_bool( "twirssi", "twirssi_debug", 0 );
919 Irssi::settings_add_bool( "twirssi", "twirssi_first_run", 1 );
920 Irssi::settings_add_bool( "twirssi", "twirssi_track_replies", 1 );
921 Irssi::settings_add_bool( "twirssi", "twirssi_use_reply_aliases", 0 );
922 $window = Irssi::window_find_name( Irssi::settings_get_str('twitter_window') );
925 Irssi::command_bind( "dm", "cmd_direct" );
926 Irssi::command_bind( "dm_as", "cmd_direct_as" );
927 Irssi::command_bind( "tweet", "cmd_tweet" );
928 Irssi::command_bind( "tweet_as", "cmd_tweet_as" );
929 Irssi::command_bind( "twitter_reply", "cmd_reply" );
930 Irssi::command_bind( "twitter_reply_as", "cmd_reply_as" );
931 Irssi::command_bind( "twitter_login", "cmd_login" );
932 Irssi::command_bind( "twitter_logout", "cmd_logout" );
933 Irssi::command_bind( "twitter_switch", "cmd_switch" );
934 Irssi::command_bind( "twirssi_upgrade", "cmd_upgrade" );
935 if ( Irssi::settings_get_bool("twirssi_use_reply_aliases") ) {
936 Irssi::command_bind( "reply", "cmd_reply" );
937 Irssi::command_bind( "reply_as", "cmd_reply_as" );
942 print "twits: ", join ", ",
943 map { "u: $_->{username}" } values %twits;
944 print "friends: ", join ", ", sort keys %friends;
945 print "nicks: ", join ", ", sort keys %nicks;
946 print "id_map: ", Dumper \%{ $id_map{__indexes} };
947 print "last poll: $last_poll";
953 ¬ice("Twirssi v$VERSION (r$REV); "
954 . "Net::Twitter v$Net::Twitter::VERSION. "
956 . JSON::Any::handler()
957 . ". See details at http://twirssi.com/" );
963 "/twitter_friend <username>",
965 sub { ¬ice("Following $_[0]"); $nicks{ $_[0] } = time; }
971 "/twitter_unfriend <username>",
973 sub { ¬ice("Stopped following $_[0]"); delete $nicks{ $_[0] }; }
976 Irssi::command_bind( "twitter_updates", "get_updates" );
977 Irssi::signal_add_last( 'complete word' => \&sig_complete );
979 ¬ice(" %Y<%C(%B^%C)%N TWIRSSI v%R$VERSION%N (r$REV)");
980 ¬ice(" %C(_(\\%N http://twirssi.com/ for full docs");
982 " %Y||%C `%N Log in with /twitter_login, send updates with /tweet");
984 my $file = Irssi::settings_get_str("twirssi_replies_store");
985 if ( $file and -r $file ) {
986 if ( open( JSON, $file ) ) {
991 my $ref = JSON::Any->jsonToObj($json);
993 my $num = keys %{ $id_map{__indexes} };
994 ¬ice( sprintf "Loaded old replies from %d contact%s.",
995 $num, ( $num == 1 ? "" : "s" ) );
998 ¬ice("Failed to load old replies from $file: $!");
1002 if ( my $provider = Irssi::settings_get_str("short_url_provider") ) {
1003 eval "use WWW::Shorten::$provider;";
1007 "Failed to load WWW::Shorten::$provider - either clear short_url_provider or install the CPAN module"
1012 if ( my $autouser = Irssi::settings_get_str("twitter_usernames")
1013 and my $autopass = Irssi::settings_get_str("twitter_passwords") )
1020 ->print( "Create a window named "
1021 . Irssi::settings_get_str('twitter_window')
1022 . " or change the value of twitter_window. Then, reload twirssi." );