Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question