lastlegion / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

Get followers for any user #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be great if Api.GetFollowers(self) took an optional param to
specify a user other than the currently authenticated user. 

python-twitter supports this behavior for retrieving friends with
GetFriends(self,user=None).

Twitter API docs suggest the appropriate URL format, e.g.
http://twitter.com/statuses/followers/bob.xml

see also http://apiwiki.twitter.com/REST+API+Documentation#followers

Original issue reported on code.google.com by chris.mu...@gmail.com on 7 Mar 2009 at 9:08

GoogleCodeExporter commented 9 years ago
I've done those changes in twitter.GetFollowers.

Cheers,
Patricio

Original comment by patricio...@gmail.com on 3 Apr 2009 at 2:47

Attachments:

GoogleCodeExporter commented 9 years ago
Here is a similar patch, that can be applied to the current svn branch.

Original comment by gue...@gmail.com on 17 Apr 2009 at 12:12

Attachments:

GoogleCodeExporter commented 9 years ago
I've applied the patch to take a user as an optional param. The number of 
followers
returned varies however. It ranges from 89, 85, 99, etc. However it is 
consistent for
the same user. So if run the script on John Doe, his first page return will 
always be 89.

This makes it difficult to return all the followers details of a specific user.

Original comment by steve%im...@gtempaccount.com on 17 Jun 2009 at 4:15

GoogleCodeExporter commented 9 years ago
Followers are the same for each page.
python-twitter-0.6.tar.gz  

I'm testing this on a user who has over 500 followers:
followers1=[]
followers2=[]
followers1=api.GetFollowers(user=userID,page=1)
followers2=api.GetFollowers(user=userID,page=2)

followers1==followers2

result: True

Why is page 2 not retrieving the next set of followers?

Original comment by goodpota...@gmail.com on 7 Mar 2010 at 6:39

GoogleCodeExporter commented 9 years ago
goodpotatoes: it's because twitter uses cursors, not pages.  they aren't 
consecutive numbers.  i ran into this same issue because python-twitter 
currently doesn't support giving me back the next_cursor and previous_cursor.  
so there's no way at all to get more than the first 100 followers.  broken, for 
sure.

Original comment by dpao...@gmail.com on 27 Jun 2010 at 12:22

GoogleCodeExporter commented 9 years ago
how do I install the patch or changes? 

Original comment by vaha...@gmail.com on 27 Apr 2012 at 1:39