Exclude keywords in Twitter Streaming API

2019-09-16 03:38发布

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条回答
Ridiculous、
2楼-- · 2019-09-16 03:51

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.

查看更多
登录 后发表回答