0

Currently I'm using Phirehose to track keywords in Twitter streams and want to track users as well.

But when I use setFollow() in my checkFilterPredicates() method, Phirehose stops working after the initial connection.

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

And this is the console output:

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>

If I use setTrack() with an array('keyword1', 'keyword2') instead, the same code works.

Am I using setFollow wrong?

Alex Bitek
  • 6,529
  • 5
  • 47
  • 77
frbry
  • 365
  • 4
  • 23

1 Answers1

0

It sounds like you're using setFollow() right - presuming you mean that you're getting no tweets coming through after calling setFollow(), it may simply be due to the fact that the user IDs that you're following are not tweeting.

That said, the streaming API should return tweets matching one or more filters, so any existing track keywords should continue to come through.

The URL params generated in the paste above is correct.

Try adding your own user ID to the follow list and tweeting yourself - you should see the tweet come through.

fenn
  • 211
  • 1
  • 6
  • I tried my UserID and I tried curl'ing the URL which works as expected. The expected behaviour is that Phirehose to wait for a tweet even there is no at the moment. If I use only setTrack it works like that actually. It keeps listening until a tweet comes, and keeps waiting after that. But when using setFollow, it simply exits, dropping to the command line. – frbry May 18 '12 at 08:52