问题
I'm using this function to get all followers from an id:
def getAllFollowers(id):
followers = tweepy.Cursor(api.followers, id = id)
temp = []
for user in followers.items():
temp.append(user)
return temp
Is there a way to get the number of followers, or friends, tweets, etc... without pagination?? Only the number.
回答1:
User objects have followers_count
, friends_count
and statuses_count
attributes for these. See the example response in the Twitter API docs: https://dev.twitter.com/overview/api/users
The number of followers this account currently has. Under certain conditions of duress, this field will temporarily indicate “0”. Example:
"followers_count": 21
回答2:
Try my solutions for count followers https://gist.github.com/3879338 In this code you need paste your data like consumer_key, consumer_secret, access_key, access_secret.
来源:https://stackoverflow.com/questions/11818638/how-to-get-number-of-followers-with-tweepy-no-pagination