]> git.sommitrealweird.co.uk Git - twirssi-net-twitter-lite.git/commitdiff
Merge branch 'master' of git://github.com/zigdon/twirssi master
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Fri, 14 May 2010 15:16:55 +0000 (16:16 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Fri, 14 May 2010 15:16:55 +0000 (16:16 +0100)
Conflicts:
twirssi.pl

1  2 
twirssi.pl

diff --cc twirssi.pl
index 45faf6fe4e3c2e38b7342e7f3e82c0bac5b4e504,0e372c746d38db9adde31ddcab95cacc3b1cc477..7099013f64cd8f1841c114cdb1e09855cc170a91
@@@ -509,11 -497,76 +497,10 @@@ sub cmd_login 
      }
      $defservice = $service = ucfirst lc $service;
  
 -    if ( $service eq 'Twitter'
 -        and Irssi::settings_get_bool("twirssi_use_oauth") )
 -    {
 -        print "Attempting OAuth for $user\@$service" if &debug;
 -        eval {
 -            if ( $service eq 'Identica' )
 -            {
 -                $twit = Net::Twitter->new(
 -                    identica => 1,
 -                    traits   => [ 'API::REST', 'API::Search' ],
 -                    source   => "twirssi",
 -                    ssl      => !Irssi::settings_get_bool("twirssi_avoid_ssl"),
 -                );
 -            } else {
 -                $twit = Net::Twitter->new(
 -                    traits => [ 'API::REST', 'OAuth', 'API::Search' ],
 -                    consumer_key => 'BZVAvBma4GxdiRwXIvbnw',
 -                    consumer_secret =>
 -                      '0T5kahwLyb34vciGZsgkA9lsjtGCQ05vxVE2APXM',
 -                    source => "twirssi",
 -                    ssl    => !Irssi::settings_get_bool("twirssi_avoid_ssl"),
 -                );
 -            }
 -        };
 -
 -        if ($twit) {
 -            if ( open( OAUTH, Irssi::settings_get_str("twirssi_oauth_store") ) )
 -            {
 -                while (<OAUTH>) {
 -                    chomp;
 -                    next unless m/$user\@$service (\S+) (\S+)/i;
 -                    print "Trying cached oauth creds for $user\@$service"
 -                      if &debug;
 -                    $twit->access_token($1);
 -                    $twit->access_token_secret($2);
 -                    last;
 -                }
 -                close OAUTH;
 -            }
 -
 -            unless ( $twit->authorized ) {
 -                my $url;
 -                eval { $url = $twit->get_authorization_url; };
 -
 -                if ($@) {
 -                    &notice("ERROR: Failed to get OAuth authorization_url. "
 -                          . "Try again later." );
 -                    return;
 -                }
 -                &notice(
 -                    "Twirssi not autorized to access $service for $user.",
 -                    "Please authorize at the following url, then enter the pin",
 -                    "supplied with /twirssi_oauth $user\@$service <pin>",
 -                    $url
 -                );
 -
 -                $oauth{pending}{"$user\@$service"} = $twit;
 -                return;
 -            }
 -        }
 -    } else {
 -        $twit = Net::Twitter->new(
 -            $service eq 'Identica' ? ( identica => 1 ) : (),
 -            username => $user,
 -            password => $pass,
 -            source   => "twirssi",
 -            ssl      => Irssi::settings_get_bool("twirssi_avoid_ssl") ? 0 : 1,
 -        );
 -    }
 -
 +    $twit = Net::Twitter::Lite->new(
 +        username => $user,
 +        password => $pass,
 +    );
      unless ($twit) {
          &notice("Failed to create object!  Aborting.");
          return;