gpt4 book ai didi

tweepy - 如何使用 Tweepy(无分页)获得关注者数量?

转载 作者:行者123 更新时间:2023-12-01 09:33:56 28 4
gpt4 key购买 nike

我正在使用此功能从 id 获取所有关注者:

def getAllFollowers(id):
followers = tweepy.Cursor(api.followers, id = id)
temp = []
for user in followers.items():
temp.append(user)

return temp

有没有办法在没有分页的情况下获得关注者、 friend 、推文等的数量?? 只有号码。

最佳答案

用户对象有 followers_count , friends_countstatuses_count这些属性。请参阅 Twitter API 文档中的示例响应: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

关于tweepy - 如何使用 Tweepy(无分页)获得关注者数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11818638/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com