【问题标题】:Analyze Twitter friends without exceeding rate limit在不超过速率限制的情况下分析 Twitter 朋友
【发布时间】:2020-10-02 21:21:56
【问题描述】:

我如何分析关注者(或关注者)列表,并计算关注者/关注者比率为

这是我用来尝试实现此目的的代码...

'''

friends = api.friends_ids(SCREEN_NAME)

count = 0

for friend in friends:
    if api.get_user(id=friend).friends_count / 
       api.get_user(id=friend).followers_count < .2:
           count += 1

print(count)

'''

我试图弄清楚列表中有多少百分比的用户拥有 5-1 的追随者与追随者的比例或更高。似乎这应该是一件容易的事,但我无法超越 API 限制。

任何帮助/建议将不胜感激。

【问题讨论】:

    标签: python-3.x twitter tweepy


    【解决方案1】:

    我用过这个,它没有限制问题,最多 3000...

    friends = []
    for friend in tweepy.Cursor(api.friends, count=200).items():
        friends.append(friend)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-31
      • 2013-01-27
      • 2013-05-12
      • 2012-08-10
      • 2014-09-21
      • 1970-01-01
      • 2011-12-22
      相关资源
      最近更新 更多