I
I
Igor Ovsyannikov2016-02-19 12:18:55
Python
Igor Ovsyannikov, 2016-02-19 12:18:55

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

The only idea that comes to my mind is to make a few additional applications at Twitter Developers to get around the 15 request per 15 minute limit and combine the api.followers_ids() and api.followers() methods. But I really hope that I just do not know some wonderfully suitable method.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-02-19
@dimonchik2013

and without an API, parsing is not an option?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question