Streaming API for multiple (and different) hashtag searches


#1

Is it possible to use Streaming API to have multiple (and different) results from hashtag searches?

My website has several pages, each one dealing with a specific argument.
I’d like to integrate a list of more recent tweets, filtered by a hashtag (the same of the argument), in each of these pages.

Can I use Streaming API, or do I have to use REST API making a different query for every page?

Thank you!


#2

Yes, if you connect with multiple comma-separated track terms, you’ll get matches for either term. But then you’ll need to filter the stream and manually decide which to show on each page.


#3

Thank you!

But is it possible even if the amount of terms to track can change dynamically?
For example, now I have X different terms to search, but tomorrow I could have Y different terms (with Y greater than X).


#4

The Streaming API is meant to be used with long-living connections – change to criteria should be infrequent and not necessarily based on direct user action in your application – as in order to change criteria you need to disconnect and reconnect your stream, giving you a window of time where you’ve missed the real time consumption of matching tweets.

It’s definitely possible to use the Streaming API this way, but you’ll need to build a kind of queueing system to manage reconnections and the change in criteria – you’ll also want to probably backfill results and/or provide some “recent” but not realtime results using the Search API.


#5

Following this question, what will happen when new data is coming but I am still processing the old data? For example, when I get new data, the program is deciding which table should store the data and new data is coming, will the new data be throwed away or store in somewhere by the sreaming api?


#6

Yes it’s possible.