目前我正在使用 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 错了吗?