Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Follow user in Tweepy

I'm looking to follow users that follow me, but I don't already follow in Tweepy. I've got the logic, but my issue is the syntax.

    for follower in followers_list:
        if follower not in friends_list:
            to_follow.append(follower)  
            print to_follow
    for follower in to_follow:
       print follower
       api.follow(follower)

Does anyone know what I should use to follow people (in place of the api.follow, which doesn't work)

like image 760
Zachary Orr Avatar asked Nov 22 '25 07:11

Zachary Orr


1 Answers

Is your followers_list filled with Twitter user.screen_names? If so, there's a topic on the issue that should help you out here.

The followers_list should be inside a comma-separated list, like the following:

stream = tweepy.Stream(auth, StreamWatcherListener(), timeout=None)
follow_list = ['1234567890', '2345678901']
track_list = None
stream.filter(follow_list, track_list)
like image 94
mudda Avatar answered Nov 23 '25 22:11

mudda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!