use vars qw($VERSION %IRSSI);
-$VERSION = "2.2.5beta";
-my ($REV) = '$Rev: 677 $' =~ /(\d+)/;
+$VERSION = "2.2.6beta";
+my ($REV) = '$Rev: 687 $' =~ /(\d+)/;
%IRSSI = (
authors => 'Dan Boger',
contact => 'zigdon@gmail.com',
. 'Can optionally set your bitlbee /away message to same',
license => 'GNU GPL v2',
url => 'http://twirssi.com',
- changed => '$Date: 2009-07-22 13:58:05 -0700 (Wed, 22 Jul 2009) $',
+ changed => '$Date: 2009-08-07 01:24:53 -0700 (Fri, 07 Aug 2009) $',
);
my $window;
ssl => Irssi::settings_get_bool("twirssi_avoid_ssl") ? 0 : 1,
);
+ unless ($twit) {
+ ¬ice("Failed to create Net::$service object! Aborting.");
+ return;
+ }
+
+ if ( my $timeout = Irssi::settings_get_int("twitter_timeout")
+ and $twit->can('ua') )
+ {
+ $twit->ua->timeout($timeout);
+ }
+
unless ( $twit->verify_credentials() ) {
¬ice("Login as $user\@$service failed");
$twit = undef;
printf $fh "id:%u account:%s type:last_id timeline\n",
$new_poll_id, $username;
- print scalar localtime, " - Polling for replies" if &debug;
+ print scalar localtime, " - Polling for replies since ",
+ $id_map{__last_id}{$username}{reply}
+ if &debug;
$new_poll_id = 0;
eval {
if ( $id_map{__last_id}{$username}{reply} )
# pretend
if ( open FILE, $filename ) {
+ binmode FILE, ":utf8";
my @lines;
my %new_cache;
while (<FILE>) {
}
if (/^-- (\d+)$/) {
- ($new_last_poll) = ($1);
- last;
+ $new_last_poll = $1;
+ if ( $new_last_poll >= $last_poll ) {
+ last;
+ } else {
+ print "Impossible! ",
+ "new_last_poll=$new_last_poll < last_poll=$last_poll!"
+ if &debug;
+ undef $new_last_poll;
+ next;
+ }
}
my ( $f, $t ) = split ' ', $_;
$nicks{$f} = $friends{$f} = $t;
".irssi/scripts/twirssi.json" );
Irssi::settings_add_int( "twirssi", "twitter_friends_poll", 600 );
+Irssi::settings_add_int( "twirssi", "twitter_timeout", 30 );
Irssi::settings_add_bool( "twirssi", "twirssi_upgrade_beta", 0 );
Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 );
Irssi::command_bind(
"twirssi_version",
sub {
- ¬ice("Twirssi v$VERSION (r$REV); "
- . "Net::Twitter v$Net::Twitter::VERSION. "
+ ¬ice(
+ "Twirssi v$VERSION (r$REV); "
+ . (
+ $Net::Twitter::VERSION
+ ? "Net::Twitter v$Net::Twitter::VERSION. "
+ : ""
+ )
+ . (
+ $Net::Identica::VERSION
+ ? "Net::Identica v$Net::Identica::VERSION. "
+ : ""
+ )
. "JSON in use: "
. JSON::Any::handler()
- . ". See details at http://twirssi.com/" );
+ . ". See details at http://twirssi.com/"
+ );
}
);
Irssi::command_bind(
sub { ¬ice("Device updated to $_[0]"); }
)
);
+ Irssi::command_bind(
+ "twitter_block",
+ &gen_cmd(
+ "/twitter_block <username>",
+ "create_block",
+ sub { ¬ice("Blocked $_[0]"); }
+ )
+ );
+ Irssi::command_bind(
+ "twitter_unblock",
+ &gen_cmd(
+ "/twitter_unblock <username>",
+ "destroy_block",
+ sub { ¬ice("Unblock $_[0]"); }
+ )
+ );
Irssi::signal_add_last( 'complete word' => \&sig_complete );
¬ice(" %Y<%C(%B^%C)%N TWIRSSI v%R$VERSION%N (r$REV)");