M
M
mr_krivosheev2015-07-04 17:06:59
Python
mr_krivosheev, 2015-07-04 17:06:59

Getting user tweets by user id using python?

You need to get the user's tweets by user id. The filter method from tweepy does not work correctly. Looked at other forums, but nothing helped. I don't understand what the problem is. I will be very grateful for your help.
My code:

from tweepy import StreamListener
from tweepy import Stream
import tweepy

access_token = "*"
access_token_secret = "*"
consumer_key = "*"
consumer_secret = "*"

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

class StdOutListener(StreamListener):

    def on_data(self, data):
        # process stream data here
        print(data)

    def on_error(self, status):
        print(status)

if __name__ == '__main__':
    listener = StdOutListener()
    twitterStream = Stream(auth, listener)
    twitterStream.filter(follow=['1680410522'])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DENIS SHELESTOV, 2015-07-05
@djdeniro

Launched tweepy from the docks, everything worked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question