Add new IDs to follow and refresh whilst live

29 views
Skip to first unread message

Ian Robertson

unread,
Dec 1, 2015, 11:46:45 AM12/1/15
to Phirehose Users
Hi All - My Phirehose app is running like a dream. I am now in a position where I need to add new IDs of people to follow. I can't see to get Phirehose to refresh this list from a MySQL table whilst staying "live" -- I don't want to stop and start Phirehose every time I add a new user!

Can anyone point me in the right direction?

Thanks!

Darren Cook

unread,
Dec 1, 2015, 4:30:58 PM12/1/15
to phireho...@googlegroups.com
> Hi All - My Phirehose app is running like a dream. I am now in a position
> where I need to add new IDs of people to follow. I can't see to get
> Phirehose to refresh this list from a MySQL table whilst staying "live" --
> I don't want to stop and start Phirehose every time I add a new user!

You have to reconnect - the list of users to follow is sent at the start
of the streaming request, and after that you receive data.

(Of course, the easy to reconnect is to restart your script; but I'm
fairly sure you can do a reconnect without having to stop your script.)

Also bear in mind connection limits: if you are getting new users every
few seconds, batch them up, so you don't have to reconnect more than
once every few minutes.


Darren

Ian Robertson

unread,
Dec 1, 2015, 4:39:36 PM12/1/15
to phireho...@googlegroups.com
Darren - thanks for your reply. For some reason I thought there was a call to set new followers and then perform a reconnect which wouldn't upset Twitter! I'll restart once an hour or something like that! Thanks again - much appreciated!


--

---
You received this message because you are subscribed to a topic in the Google Groups "Phirehose Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phirehose-users/31GNE1hDd18/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phirehose-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karthik Murugan

unread,
Dec 6, 2015, 5:44:13 AM12/6/15
to phireho...@googlegroups.com
You could update track/follow from checkFilterPredicates() function.

You received this message because you are subscribed to the Google Groups "Phirehose Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phirehose-use...@googlegroups.com.

Darren Cook

unread,
Dec 6, 2015, 6:50:37 AM12/6/15
to phireho...@googlegroups.com
> You could update track/follow from checkFilterPredicates() function.

Thanks Karthik. I should've stopped to check the code before replying.
Some documentation is here:

https://github.com/fennb/phirehose/wiki/Introduction#implementation-recommended

(Though the link to dev.twitter.com is broken.)

It is implemented as calling reconnect() if you have made a call to
setFollow() or setTrack() or setLocations() since the last time it checked:

https://github.com/fennb/phirehose/blob/63d638473bf8e9e70f0bfc7785a6b557594d17c8/lib/Phirehose.php#L509

Darren
--
Darren Cook, Software Researcher/Developer
My new book: Data Push Apps with HTML5 SSE
Published by O'Reilly: (ask me for a discount code!)
http://shop.oreilly.com/product/0636920030928.do
Also on Amazon and at all good booksellers!
Reply all
Reply to author
Forward
0 new messages