【发布时间】:2014-06-05 21:43:45
【问题描述】:
我正在创建一个 Twitter 机器人,它将响应指向其关联 Twitter 句柄的推文。我看过有关如何按主题标签过滤流的文档,但我不知道如何按提及进行过滤。例如,如果与机器人关联的 Twitter 句柄是 twitter_bot,我想做这样的事情:
listener = CustomListener()
stream = tweepy.Stream(OAuth, listener)
# Is there a parameter here that accomplishes this??
stream.filter(mentions=["twitter_bot"])
我只想处理有人在 twitter_bot 句柄上发推文的情况。
即。 “@twitter_bot 进展如何?”
谢谢!
【问题讨论】:
-
我找不到任何东西,但你可能会,这里是源代码github.com/tweepy/tweepy/blob/master/tweepy/streaming.py
标签: python tweepy twitter-streaming-api