Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Twitter CPAN distribution.

Report information
The Basics
Id: 29949
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Net-Twitter

People
Owner: cthom [...] cpan.org
Requestors: hide [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.06
Fixed in: (no value)



Subject: user_timeline method doesn't work
Some Twitter API's responses don't have "WWW-Authenticate" header, for example user_timeline. It means LWP::UserAgent will fail to send request with "authorization" header, because LWP::UA try to send authorized request after get status 401 response with WWW-Authenticate header.
Subject: Net-Twitter.patch
*** Twitter.pm.org Fri Oct 12 21:04:45 2007 --- Twitter.pm Fri Oct 12 21:06:46 2007 *************** *** 33,61 **** $conf{twittervision} = '0' unless defined $conf{twittervision}; $conf{ua} = LWP::UserAgent->new(); ! $conf{ua}->credentials($conf{apihost}, ! $conf{apirealm}, ! $conf{username}, ! $conf{password} ! ); $conf{ua}->agent("Net::Twitter/$Net::Twitter::VERSION"); $conf{ua}->default_header( "X-Twitter-Client:" => $conf{clientname} ); $conf{ua}->default_header( "X-Twitter-Client-Version:" => $conf{clientver} ); $conf{ua}->default_header( "X-Twitter-Client-URL:" => $conf{clienturl} ); $conf{ua}->env_proxy(); if ($conf{twittervision}) { $conf{tvua} = LWP::UserAgent->new(); ! $conf{tvua}->credentials($conf{tvhost}, ! $conf{tvrealm}, ! $conf{username}, ! $conf{password} ! ); $conf{tvua}->agent("Net::Twitter/$Net::Twitter::VERSION"); $conf{tvua}->default_header( "X-Twitter-Client:" => $conf{clientname} ); $conf{tvua}->default_header( "X-Twitter-Client-Version:" => $conf{clientver} ); $conf{tvua}->default_header( "X-Twitter-Client-URL:" => $conf{clienturl} ); $conf{tvua}->env_proxy(); } --- 33,63 ---- $conf{twittervision} = '0' unless defined $conf{twittervision}; $conf{ua} = LWP::UserAgent->new(); ! #$conf{ua}->credentials($conf{apihost}, ! # $conf{apirealm}, ! # $conf{username}, ! # $conf{password} ! # ); $conf{ua}->agent("Net::Twitter/$Net::Twitter::VERSION"); $conf{ua}->default_header( "X-Twitter-Client:" => $conf{clientname} ); $conf{ua}->default_header( "X-Twitter-Client-Version:" => $conf{clientver} ); $conf{ua}->default_header( "X-Twitter-Client-URL:" => $conf{clienturl} ); + $conf{ua}->default_headers->authorization_basic($conf{username}, $conf{password}); $conf{ua}->env_proxy(); if ($conf{twittervision}) { $conf{tvua} = LWP::UserAgent->new(); ! #$conf{tvua}->credentials($conf{tvhost}, ! # $conf{tvrealm}, ! # $conf{username}, ! # $conf{password} ! # ); $conf{tvua}->agent("Net::Twitter/$Net::Twitter::VERSION"); $conf{tvua}->default_header( "X-Twitter-Client:" => $conf{clientname} ); $conf{tvua}->default_header( "X-Twitter-Client-Version:" => $conf{clientver} ); $conf{tvua}->default_header( "X-Twitter-Client-URL:" => $conf{clienturl} ); + $conf{tvua}->default_headers->authorization_basic($conf{username}, $conf{password}); $conf{tvua}->env_proxy(); } *************** *** 69,79 **** $apirealm ||= 'Twitter API'; $apihost ||= 'twitter.com:80'; ! $self->{ua}->credentials($apihost, ! $apirealm, ! $username, ! $password ! ); } --- 71,83 ---- $apirealm ||= 'Twitter API'; $apihost ||= 'twitter.com:80'; ! #$self->{ua}->credentials($apihost, ! # $apirealm, ! # $username, ! # $password ! # ); ! ! $self->{ua}->default_headers->authorization_basic($username, $password); }
I will look at this over the weekend. I have glanced at the patch and need to evaluate how it affects the ability to change credentials, etc. If all is well, I should have a new version released soon.
I cannot replicate this error, and both the module and the API have churned so much in the interim, it's not really relevant anymore. If there's still a problem, please reopen.