From c8726ad2993d45e82b37ae846310181d4200e5ed Mon Sep 17 00:00:00 2001 From: Dan Boger Date: Tue, 26 Jan 2010 10:59:44 -0800 Subject: [PATCH] v2.4.1beta - Remove use of the Net::Identica object, using 'identica => 1' instead. Don't attempt to use OAuth with identica accounts. --- twirssi.pl | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/twirssi.pl b/twirssi.pl index 9cbf2ff..0c433cd 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -8,11 +8,12 @@ use LWP::Simple; use Data::Dumper; use Encode; use POSIX qw/:sys_wait_h/; +use Net::Twitter qw/3.05/; $Data::Dumper::Indent = 1; use vars qw($VERSION %IRSSI); -$VERSION = "2.4.0"; +$VERSION = "2.4.1beta"; %IRSSI = ( authors => 'Dan Boger', contact => 'zigdon@gmail.com', @@ -509,18 +510,12 @@ sub cmd_login { } $defservice = $service = ucfirst lc $service; - print "Loading Net::$service" if &debug; - eval "use Net::$service 3.05"; - if ($@) { - ¬ice( - "Failed to load Net::$service when trying to log in as $user: $@"); - return; - } - - if ( Irssi::settings_get_bool("twirssi_use_oauth") ) { + if ( $service eq 'Twitter' and + Irssi::settings_get_bool("twirssi_use_oauth") ) { print "Attempting OAuth for $user\@$service" if &debug; eval { - $twit = "Net::$service"->new( + $twit = Net::Twitter->new( + $service eq 'Identica' ? ( identica => 1 ) : (), traits => [ 'API::REST', 'OAuth' ], consumer_key => 'BZVAvBma4GxdiRwXIvbnw', consumer_secret => '0T5kahwLyb34vciGZsgkA9lsjtGCQ05vxVE2APXM', @@ -563,7 +558,8 @@ sub cmd_login { } } } else { - $twit = "Net::$service"->new( + $twit = Net::Twitter->new( + $service eq 'Identica' ? ( identica => 1 ) : (), username => $user, password => $pass, source => "twirssi", @@ -572,7 +568,7 @@ sub cmd_login { } unless ($twit) { - ¬ice("Failed to create Net::$service object! Aborting."); + ¬ice("Failed to create object! Aborting."); return; } -- 2.39.5