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: 41707
Status: resolved
Priority: 0/
Queue: Net-Twitter

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

Bug Information
Severity: Important
Broken in: 1.17
Fixed in: (no value)



Subject: [Patch] Add support for "page" parameter to followers
Net::Twitter doesn't support the "page" parameter in the "followers" method, making it impossible to retrieve more than the most recent 100 followers. The attached patch provides that support, however you may want to implement it differently. Also note that the Net::Twitter documentation refers to twitter defaults of 20 in several places when the current twitter API indicates 100 (method friends, for instance). Thanks again for your work on Net::Twitter, Chris. -Marc
Subject: net-twitter.patch
diff --git a/lib/Net/Twitter.pm b/lib/Net/Twitter.pm index 43a3a05..1ea0297 100755 --- a/lib/Net/Twitter.pm +++ b/lib/Net/Twitter.pm @@ -10,6 +10,7 @@ use warnings; use strict; use LWP::UserAgent; +use URI; use URI::Escape; use JSON::Any; @@ -251,8 +252,11 @@ sub following { sub followers { my ( $self, $args ) = @_; - my $url = $self->{apiurl} . "/statuses/followers.json"; - $url .= ( $args->{lite} ) ? "?lite=true" : ""; + my $url = URI->new($self->{apiurl} . "/statuses/followers.json"); + + my %args = %$args; # local copy + $args{lite} = 'true' if $args{lite}; + $url->query_form(%args); my $req = $self->{ua}->get($url); $self->{response_code} = $req->code; $self->{response_message} = $req->message;
On Sun Dec 14 17:17:22 2008, MMIMS wrote: Show quoted text
> Net::Twitter doesn't support the "page" parameter in the "followers" > method, making it impossible to retrieve more than the most recent 100 > followers.
I was about to post the very same bug report! I would also notice that the documentation (as found today at http://apiwiki.twitter.com/REST+API+Documentation#followers) does not mention any 'lite' parameter, but an id parameter. Your implementation honours both, even though isn't too picky with spurious parameters and I don't know how twitter reacts (or will react).
This is yet another example of Twitter API churn. I'll get the patch applied and get 1.18 out, hopefully today. I'll also go through the rest of the API doc to make sure it's matched up.
This is fixed in Net::Twitter 1.18, just released to CPAN.