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.0beta";
+$VERSION = "2.4.1beta";
%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-08-07 01:24:53 -0700 (Fri, 07 Aug 2009) $',
+ changed => 'Fri Jan 22 14:40:48 PST 2010',
);
my $window;
}
$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',
}
unless ( $twit->authorized ) {
+ my $url;
eval {
- my $url = $twit->get_authorization_url;
+ $url = $twit->get_authorization_url;
};
if ($@) {
}
}
} else {
- $twit = "Net::$service"->new(
+ $twit = Net::Twitter->new(
+ $service eq 'Identica' ? ( identica => 1 ) : (),
username => $user,
password => $pass,
source => "twirssi",
}
unless ($twit) {
- ¬ice("Failed to create Net::$service object! Aborting.");
+ ¬ice("Failed to create object! Aborting.");
return;
}