Exclude keywords in Twitter Streaming API

旧巷老猫 提交于 2019-12-25 03:27:40

问题


Currently, I am using the Twitter streaming API to get realtime tweets for certain keywords. However, I would like to skip tweets that are irrelevant before getting them.

With the Search API I can search for "hello -john" so I only get tweets that contain the word hello, but not John or I can search for "hello Maria OR Andrew" so I get only tweets that contain the word hello AND either Maria or Andrew.

With the Streaming API, I can only give keywords but is there a way I can use -john or things like OR in these keywords?


回答1:


Unfortunately, there's no way to exclude keywords via the streaming API. The docs only specify the ability to add keywords to the search but not exclude. You'll need to filter words out in your code.



来源:https://stackoverflow.com/questions/6465757/exclude-keywords-in-twitter-streaming-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!