Open DanielaSfregola opened 6 years ago
You can indeed! ~By concatenating tracks using spaces instead of commas.~
EDIT: ORs are expressed with commas, AND are expressed with spaces
See https://developer.twitter.com/en/docs/tweets/filter-realtime/guides/basic-stream-parameters#track
I think it is the other way around if I read the docs.
By this model, you can think of commas as logical ORs, while spaces are equivalent to logical ANDs (e.g. ‘the twitter’ is the AND twitter, and ‘the,twitter’ is the OR twitter).
So that means you would support OR by default, while AND is also implicitly supported (just add one string with spaces)
Thanks @wzorgdrager! You are absolutely right -- I've fixed my comment.
SHORT TERM SOLUTION: Currently we use Seq[String] that is then converted to comma-separated list. So maybe all we need is just better scaladoc to clarify this difference
LONG TERM SOLUTION: When we have time, we should also think of having a dedicated type to express this ANDs - ORs relations (we could use it for the search API too!): Seq[String] is not expressive enough!
This came from a discussion on Gitter:
""" I am going to create a ticket to investigate if we can compose hashtags when streaming, i.e.: create a stream that returns tweet about #scala OR #functionalprogramming. I know you can do it with the search REST api (since they have a dedicated syntax) ....not sure about the streaming API """