Search code examples
javascripttwittertwitter-streaming-api

Is there a way to do AND operation on twitter streaming api filters?


I know you can filter for different elements of the tweet - I've got this:

twit.stream('statuses/filter', { 
    track : trcks,
    locations  : locs
    }, etc....

tracking certain words and certain locations. But the results returned are filtered by 'trcks' OR 'locs', not 'trcks' AND 'locs'. Is there any way to do this? Or other logical operations for that matter?


Solution

  • No you cannot do and, only or ... from the docs :

    Bounding boxes do not act as filters for other filter parameters. For example track=twitter&locations=-122.75,36.8,-121.75,37.8 would match any tweets containing the term Twitter (even non-geo tweets) OR coming from the San Francisco area.

    (Emphasis mine)