0
目前我使用Phirehose跟蹤Twitter流中的關鍵字,並且也想跟蹤用戶。使用setFollow時Phirehose退出
但是,當我在我的checkFilterPredicates()
方法中使用setFollow()
方法時,Phirehose在初始連接後停止工作。
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()
與array('keyword1', 'keyword2')
取而代之的是,相同的代碼工作。
我用setFollow錯了嗎?
我試過我的用戶ID,我試圖curl'ing URL工作正常。預期的行爲是Phirehose現在還沒有等待推文。如果我只使用setTrack,它實際上就是這樣工作的。它會一直聽,直到推特出現,並在那之後繼續等待。但是,當使用setFollow時,它只是退出,下降到命令行。 – frbry