开发者

Phirehose hangs?

I'm trying to use Phirehose to get Twitter tweets for a particular keyword but it always seems to hang when I launch the page on my site. There are two examples, I have:

1) using 140dev's work (with a good MySQL dB setup): http://www.rioleo.org/projecthaiti/streamer/db/get_tweets.php

2) using Phirehose only http://www.rioleo.org/projecthaiti/stream/example/sample.php

I've noticed that I get output sometimes开发者_如何学C when I do

$sc = new SampleConsumer('username', 'pass', Phirehose::METHOD_SAMPLE);
$sc->consume();

but it hangs unceremoniously when I do:

$sc = new SampleConsumer('username', 'pass', Phirehose::METHOD_FILTER);
$sc->setTrack(array('keyword'));
$sc->consume();

right now enqueueStatus($status) just echoes the $status.

I realize the whole point of Phirehose is to have it run for a certain amount of time, collect tweets and then play around with them, but I'm not sure I understand how the code I have should at least get me partially there. An enlightenment would be greatly appreciated.

Thanks!


There are erros in the Phirehose code and a few blocking calls. Look at these defect reports http://code.google.com/p/phirehose/issues/list

This issue in particular should describe how to partially fix the code: http://code.google.com/p/phirehose/issues/detail?id=4

I've also found its good to remove the feof() call from the consume while loop as this is a blocking call in PHP and can cause hangs in my experience.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜