You also need a keep-alive of greater than 30 seconds. And by default
PHP funtions timeout after 30 seconds, so you'll need to change that to
keep the script running indefinitely.
Jim Gilliam wrote:
> I ran into the same problem trying to do this in Ruby last night using
> this technique:
> I think it's because /statuses/filter.json requires a POST, which
> isn't supported by yajl-ruby. So I'm stuck. It works fine if you use
> one of the other GET methods like /statuses/sample.json.
> Jim Gilliam
> On Sat, Sep 19, 2009 at 7:31 AM, Greg <gregory.av...@gmail.com
> <mailto:gregory.av...@gmail.com>> wrote:
> I'm trying to implement Streaming API on my Twitter application to
> enhance the stabilty instead of using the Search API.
> Basically - I'm trying to use the track paramter to track a keyword.
> However, when I run this code - it just times out - nothing occurs.
> Perhaps I'm not using the track parameter correctly?
> I know I'm just dumping the code right now - but it was merely for
> My ad-hoc code is below:
> // twitter_stream.php
> $fp = fopen("http://username:passw...@stream.twitter.com/1/statuses/
> while($data = fgets($fp))
> $new_data = json_decode($data);
> foreach($status as $new_data)
> echo "<hr>";
> Thanks for the help!