I tried the following codes:
class MyListener(StreamListener):
def on_data(self, data):
print(data)
return True
listener = MyListener()
auth = OAuthHandler(config.API_KEY, config.API_SECRET)
auth.set_access_token(config.ACCESS_TOKEN, config.ACCESS_TOKEN_SECRET)
stream = Stream(auth, listener)
stream.filter(follow=['<user_id>']) # assume this user is a celebrity
What I got when running this code, is many spam-tweets or retweets by other users. (assume this <user id>
is a celebrity, who has millions of followers. The followers are sharing the tweets all the time)
But I want to stream the original tweets published only
by this specific <user id>
. How can I implement this? Thanks in advance.