Streaming API for Pharo?
Hi All, we are playing with Roassal for the visualization of Twitter data. So far we used Zn-SSO to connect to twitter and call REST API to get some tweets for playing. Now, we would like to use the streaming API. I could not figure out how to do this with Zn-*. According to Twitter Streaming API docs: Some HTTP client libraries only return the response body after the connection has been closed by the server. These clients will not work for accessing the Streaming API. You must use an HTTP client that will return response data incrementally I would like to know if Zn allows to get data incrementally. Furthermore it would be great to know if there is some example where I can start from. Once we have our toy working we plan to release it to the community. thanks. art
Arturo Zambrano wrote
I would like to know if Zn allows to get data incrementally
The Nabble mirror (http://forum.world.st/Pharo-f1294836.html will check both dev and user lists) has a great search feature. "Zinc stream" returned some interesting results... ----- Cheers, Sean -- View this message in context: http://forum.world.st/Streaming-API-for-Pharo-tp4743273p4743294.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
thanks! I will take a look at it. art On Thu, Feb 13, 2014 at 11:48 AM, Sean P. DeNigris <sean@clipperadams.com>wrote:
Arturo Zambrano wrote
I would like to know if Zn allows to get data incrementally
The Nabble mirror (http://forum.world.st/Pharo-f1294836.html will check both dev and user lists) has a great search feature. "Zinc stream" returned some interesting results...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Streaming-API-for-Pharo-tp4743273p4743294.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hello Arturo, On 13 Feb 2014, at 15:00, Arturo Zambrano <arturo.zambrano@gmail.com> wrote:
Hi All, we are playing with Roassal for the visualization of Twitter data. So far we used Zn-SSO to connect to twitter and call REST API to get some tweets for playing.
Now, we would like to use the streaming API. I could not figure out how to do this with Zn-*.
According to Twitter Streaming API docs: Some HTTP client libraries only return the response body after the connection has been closed by the server. These clients will not work for accessing the Streaming API. You must use an HTTP client that will return response data incrementally
I would like to know if Zn allows to get data incrementally. Furthermore it would be great to know if there is some example where I can start from.
Once we have our toy working we plan to release it to the community.
thanks.
art
Zinc HTTP Components is a framework that does allow you to do pretty much everything related to HTTP. I would suggest you load the Zinc WebSockets addon package: https://github.com/svenvc/docs/blob/master/zinc/zinc-websockets-paper.md In particular, look at ZnWebSocket class>>#to: where after an initial request/response interaction, the actual connection used in the client is taken and used to run a completely different protocol. I guess in your case you would then keep on reading responses. But it might be simpler than that, if the server returns an actual infinite response, you could ask for ZnClient>>#streaming: true and use the resulting ZnStreamingResponse's contents (a stream) to keep on reading. Good luck and let me know how it goes, I am pretty sure we can get this working ! If you can tell me how I can access such a response with my twitter account, I can try as well. Sven
Thanks Sven, I will give it a try. Best regards art On Thu, Feb 13, 2014 at 4:35 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hello Arturo,
On 13 Feb 2014, at 15:00, Arturo Zambrano <arturo.zambrano@gmail.com> wrote:
Hi All, we are playing with Roassal for the visualization of Twitter data. So far we used Zn-SSO to connect to twitter and call REST API to get some tweets for playing.
Now, we would like to use the streaming API. I could not figure out how to do this with Zn-*.
According to Twitter Streaming API docs: Some HTTP client libraries only return the response body after the connection has been closed by the server. These clients will not work for accessing the Streaming API. You must use an HTTP client that will return response data incrementally
I would like to know if Zn allows to get data incrementally. Furthermore it would be great to know if there is some example where I can start from.
Once we have our toy working we plan to release it to the community.
thanks.
art
Zinc HTTP Components is a framework that does allow you to do pretty much everything related to HTTP. I would suggest you load the Zinc WebSockets addon package:
https://github.com/svenvc/docs/blob/master/zinc/zinc-websockets-paper.md
In particular, look at ZnWebSocket class>>#to: where after an initial request/response interaction, the actual connection used in the client is taken and used to run a completely different protocol. I guess in your case you would then keep on reading responses.
But it might be simpler than that, if the server returns an actual infinite response, you could ask for ZnClient>>#streaming: true and use the resulting ZnStreamingResponse's contents (a stream) to keep on reading.
Good luck and let me know how it goes, I am pretty sure we can get this working !
If you can tell me how I can access such a response with my twitter account, I can try as well.
Sven
participants (3)
-
Arturo Zambrano -
Sean P. DeNigris -
Sven Van Caekenberghe