[twitter-api-announce] Logical AND supported in streaming API filter endpoint

158 views
Skip to first unread message

Mark McBride

unread,
Apr 19, 2010, 7:39:09 PM4/19/10
to twitter-deve...@googlegroups.com, twitter-ap...@googlegroups.com
To date the streaming API has only supported logical OR in track
keywords (http://apiwiki.twitter.com/Streaming-API-Documentation#track).
 Today we're happy to announce that we support logical ANDing in
production as well.

The track parameter is treated as a series of phrases. Phrases are
separated by commas. Words within phrases are delimited by spaces. A
tweet matches if any phrase matches. A phrase matches if all of the
words are present in the tweet. (e.g. 'the twitter' is 'the' AND
'twitter', and 'the,twitter' is 'the' OR 'twitter'.).  Some
examples...
1) "twitter api,twitter streaming"
(http://stream.twitter.com/1/statuses/filter.xml?track=twitter+api%2Ctwitter+streaming)
will match the tweets "The Twitter API is awesome" and "The twitter
streaming deal is fast", but not "I'm new to Twitter"
2) The same approach to dealing with case, punctuation, @replies and
hashtags still applies.  So "chirp search,chirp streaming"
(http://stream.twitter.com/1statuses/filter.xml?track=chirp+search%2Cchirp+streaming)
will match "Listening to the @chirp talk on search", "I'm at Chirp
talking about search!", and "loving this search talk #chirp"

This should dramatically close the gap on what you can do with the
search API but not with streaming, and also reduce the amount of data
users have to consumer to match on multiple keywords.
Comments/questions welcome as always.

  ---Mark

http://twitter.com/mccv

--
Twitter API documentation and resources: http://apiwiki.twitter.com
API updates via Twitter: http://twitter.com/twitterapi
Change your membership to this group: http://groups.google.com/group/twitter-api-announce?hl=en
Reply all
Reply to author
Forward
0 new messages