0
我創建一個Twitter的機器人將要針對其相關的Twitter的手柄鳴叫回應。我見過有關如何通過hashtags過濾流的文檔,但我不知道如何通過提及過濾。例如,如果與機器人相關的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怎麼樣?」
謝謝!
我找不到任何東西,但你可能在這裏是源代碼https://github.com/tweepy/tweepy/blob/master/tweepy/streaming.py –