From: Dan Boger Date: Tue, 26 Jan 2010 18:59:44 +0000 (-0800) Subject: v2.4.1beta - Remove use of the Net::Identica object, using 'identica => 1' instead... X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/commitdiff_plain/c8726ad2993d45e82b37ae846310181d4200e5ed?hp=--cc v2.4.1beta - Remove use of the Net::Identica object, using 'identica => 1' instead. Don't attempt to use OAuth with identica accounts. --- c8726ad2993d45e82b37ae846310181d4200e5ed 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; }