Is there a threshold of tweets that need to occur before you receive the stream?


I am using the stream API and notice that for light streams the consume-stream.php example (obviously in the php lib) does not print out the tweets.

When I choose a heavy stream it appears to work (say all tweets that mention apple). I know the stream is valid since the I can monitor it in the test page. Maybe this is a function of the php library (buffering the output)?


Using the streaming API there is no buffering - interactions are sent as DataSift finds them. Buffering only occurs on the REST API. 

Have you tried sending test Tweets matching your CSDL filter? It may just be a case of no Tweets matching your filter being sent while you were running your test.


I’ve sent numerous tweets. I am leaning toward it being an issue with the php output buffering. I am able to verify capture by only listening for the first n occurrences. Just wanted to verify that I was not missing something on the API end.


As I said before, the consume-stream.php example does not use any form of PHP buffering - it is a *live* stream of anything your CSDL filter matches. 

- How are you running the tests that are failing? Through a browser, command line?

- Have you tried running any of the other examples included in the library?

- Are you trying to run the examples from behind any kind of proxy or corporate network / firewall?


Hey Jason. Thanks for the follow up. I actually copied and pasted the API code for the PHP lib verbatim and tried to run it on a local webserver and on a hosted account. Both were unsuccessful in capturing my test tweets, However, when I used the football examples in the PHP examples they worked (those tests wait for ten occurrences then stop).

When I say buffering, I mean the actual output buffer for PHP (I believe PHP buffers the output internally).


As a follow up I can successfully run the curl example and see the tweets… which further leads me to think it’s a PHP artifact and not the API.


My apologies, I didn't realise you were running this through a browser. In this case, yes the results will be buffered for a time before being output to screen.

If you contact DataSift Support with your application use case, the support team may be able to suggest a 'best practice' regarding the applicaiton you are looking to develop. 


Thanks again Jason. Everything seems fine… just user error. I’ll keep the support in mind. Appreciate the support.