0

目前我正在使用 Phirehose 来跟踪 Twitter 流中的关键字,并且也想跟踪用户。

但是当我setFollow()在我的checkFilterPredicates()方法中使用时,Phiehose 在初始连接后停止工作。

public function checkFilterPredicates() {
    $this->setFollow(array(12));
}

这是控制台输出:

Phirehose: Connecting to twitter stream: https://stream.twitter.com/1/statuses/f
ilter.json with params: array (  'delimited' => 'length',  'follow' => '12',)
Phirehose: Resolved host stream.twitter.com to 199.59.148.138
Phirehose: Connecting to ssl://199.59.148.138, port=443, connectTimeout=5
Phirehose: Connection established to 199.59.148.138
Phirehose: POST /1/statuses/filter.json HTTP/1.0

Phirehose: Host: stream.twitter.com:443

Phirehose: Content-type: application/x-www-form-urlencoded

Phirehose: Content-length: 26

Phirehose: Accept: */*

Phirehose: Authorization: Basic: dHdpenlvbjpUZW1wbzEyMw==

Phirehose: User-Agent: Phirehose/0.2.gitmaster +https://github.com/fennb/phireho
se

Phirehose:

Phirehose: delimited=length&follow=12

Phirehose:


c:\devel\stream>

如果我改用setTrack()an array('keyword1', 'keyword2'),则相同的代码可以工作。

我使用 setFollow 错了吗?

4

1 回答 1

0

听起来您使用setFollow()正确 - 假设您的意思是在 call 后没有收到任何推文setFollow(),这可能仅仅是因为您关注的用户 ID 没有发推文。

也就是说,流 API 应该返回与一个或多个过滤器匹配的推文,因此任何现有的跟踪关键字都应该继续通过。

上面粘贴中生成的 URL 参数是正确的。

尝试将您自己的用户 ID 添加到关注列表并自己发推文 - 您应该会看到推文通过。

于 2012-05-17T23:26:33.997 回答