Skip to content
Discussion options

You must be logged in to vote

You should be able to do this by setting the terms as a single phrase in the track parameter, separated only by whitespace. You can consider whitespace a logical AND, so it doesn't take into account ordering. For example

myStream.filter(track=['like basketball'])

should find a sentence such as "we like to play the basketball" as both "like" AND "basketball" are in it. Similarly, it would find a sentence like "basketball is fun and I like to play it". But it won't find a sentence with only 1 of the terms, for example "I've never played basketball".

You can find documentation on stream parameters and how to use them in the Twitter dev docs here (6. Track):
https://developer.twitter.com/en/d…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This is a question API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion
3 participants
Converted from issue

This discussion was converted from issue #1335 on December 15, 2020 19:51.