1
我正在制作一个程序,它使用Tweepy提取实时推文,并通过函数运行它。我正在使用Tweepy Stream来完成获取推文的任务。不过,我希望在功能运行时,Tweepy仍然可以提取这些实时推文。我相信我需要线程Tweepy事件监听器,但我不完全知道如何做到这一点。如何打印Tweepy流
def doesSomething(s):
#function here
class listener(tweepy.StreamListener):
def on_status(self, status):
doesSomething(status)
stream_listener = listener()
tweepy.Stream(auth = api.auth, listener=stream_listener)
stream.filter(track=["Example"])