Answer the question
In order to leave comments, you need to log in
How to get Twitter user ID 450K followers and not fall asleep?
I'll skip the charming stories about how I met a lady on a tram and could only peek at her Twitter subscriptions, straight to the point:
What's the fastest way to get a list of 450,000 follower IDs from a user? Or is it possible to somehow immediately find out which people are subscribed to three or four twitters at once? I'm using Tweepy, the piece of code is this:
api = tweepy.API(auth)
def limit_handled(cursor):
while True:
try:
yield cursor.next()
except tweepy.RateLimitError:
print("waiting!")
time.sleep(15*60)
subscribers1 = set(limit_handled(tweepy.Cursor(api.followers_ids, "чей-то-твиттер", count=5000).items()))
subscribers2 = set(limit_handled(tweepy.Cursor(api.followers_ids, "ещё-чей-то-твиттер", count=5000).items()))
subscrivers3 = subscribers1 & subscribers2
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question