Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 79089
Status: resolved
Priority: 0/
Queue: Net-Twitter-Lite

People
Owner: Nobody in particular
Requestors: NHORNE [...] cpan.org
Cc:
AdminCc:

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



Subject: friends() only returns 100 friends
friends() only returns 100 matches. I have not given the optional cursor argument.
On Sun Aug 19 12:13:11 2012, NHORNE wrote: Show quoted text
> friends() only returns 100 matches. I have not given the optional > cursor argument.
The friends method is deprecated. Twitter previously announced they would remove it from the API on May 14, 2012. Obviously, they haven't, but you still shouldn't use it in code. Twitter recommends using the friends_ids and lookup_users API methods to replace the usage of friends. Often, before eliminated a deprecated method, Twitter changes the way it behaves, apparently as a "signal" of the impending change. Perhaps that's what we're seeing here. I marked this "rejected" since it isn't a Net::Twitter::Lite bug. -Marc
Subject: Re: [rt.cpan.org #79089] friends() only returns 100 friends
Date: Sun, 19 Aug 2012 17:40:08 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
Thank you for your reply. The problem with friends_ids() is that it takes a required argument (id), and I can't see anywhere in the documentation how to find out what my id is. I'm not saying it isn't documented, however I am saying I can't find it! An example would help. -Nigel
Download smime.p7s
application/pkcs7-signature 4.3k

Message body not shown because it is not plain text.

On Sun Aug 19 12:40:23 2012, njh@bandsman.co.uk wrote: Show quoted text
> > Thank you for your reply. The problem with friends_ids() is that it > takes a required argument (id), and I can't see anywhere in the > documentation how to find out what my id is. I'm not saying it isn't > documented, however I am saying I can't find it! An example would help.
Here's some more information on the deprecation of friends: https://dev.twitter.com/docs/api/1/get/statuses/friends You don't need an id argument unless you're getting someone else's friends. If you're getting your own (those of the authenticated user), just pass a cursor: my $r = $nt->friends_ids({ cursor => -1 }); If you're getting friends of someone else, you can pass their numeric ID or screen name: my $r = $nt->friends_ids({ user_id => $numeric_twitter_id, cursor => -1 }); my $r = $nt->friends_ids({ screen_name => $screen_name, cursor => -1 }); Although, it isn't necessary to pass an id to get your own friends, it works. Passing your own screen name has the same effect as not passing an id at all. Hope that helps. -Marc
Subject: Re: [rt.cpan.org #79089] friends() only returns 100 friends
Date: Sun, 19 Aug 2012 18:17:40 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
Show quoted text
> Hope that helps.
Thanks - I'll give it a try and report back. -Marc
Download smime.p7s
application/pkcs7-signature 4.3k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #79089] friends() only returns 100 friends
Date: Sun, 19 Aug 2012 20:04:33 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
That's working better, thanks! Can I suggest that the documentation needs a bit of work? Now to figure out how to stop this a giving Twitter error: my $following = $n->following_ids({ cursor => -1 }); $id_details = $n->lookup_users({ user_id => $following->{ids} }); Regards, -Nigel
Download smime.p7s
application/pkcs7-signature 4.3k

Message body not shown because it is not plain text.

Show quoted text
> The friends method is deprecated.
What has it been replaced with?
Subject: Re: [rt.cpan.org #79089] friends() only returns 100 friends
Date: Mon, 17 Jun 2013 10:05:22 -0700
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: Marc Mims <marc [...] questright.com>
Twitter recommends using `friends_ids` then calling `lookup_users` to get user objects for the IDs. `friends_ids` returns up to 5,000 ids per call. `lookup_users` takes up to 100 user IDs per call. So, there's a bit of code to write to get what `friends` used to give us. On Mon, Jun 17, 2013 at 6:54 AM, Nigel Horne via RT <bug-Net-Twitter-Lite@rt.cpan.org> wrote: Show quoted text
> Queue: Net-Twitter-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=79089 > >
>> The friends method is deprecated.
> > What has it been replaced with? > > >