Search code examples
node.jstwitter

Node.js with Twit - AND Operator issue


I am having an issue getting the twit node.js bot to recognize multiple parameters when attempting to RT when it is both a listed user in the code, as well as containing a specified hashtag.

var stream = bot.stream('statuses/filter', {follow: approved_users, track: '#somehashtag'}

While this seems to work on an either/or basis how can this me modified so that it is an AND condition?

I've been looking through the documentation, and while I am assuming this should be a relatively simple fix I am not familiar enough with node.js to recognize immediately where the issue is.

Any help on this would be greatly appreciated!


Solution

  • Per the Twitter documentation, it is not possible to AND these filter types:

    The track, follow, and locations fields should be considered to be combined with an OR operator. track=foo&follow=1234 returns Tweets matching "foo" OR created by user 1234.

    The only way you'd be able to do something more complicated in real time would be to use the enterprise PowerTrack API, which is a commercial offering.