[Seaside] Zinc - Twitter - Streaming API - Long lived connections
Sven Van Caekenberghe
sven at beta9.be
Fri Oct 21 08:48:15 UTC 2011
On 21 Oct 2011, at 10:20, Davorin Rusevljan wrote:
> I was not sure where to fire this question, but Seaside groups seemed like the most probable place to reach people who might know the answer.
> So, I might need to access Twitter streaming API. The catch is that streaming api uses long lived HTTP connections, where twitter server over the time pushes json encoded chunks of data, as they appear in users time line. For that http client used (I gues Zinc), must not wait for server to close the connection in order to return the data to the Smalltalk code, but instead, it shoud forward it to smalltalk code as it arrives.
> Can Zinc do that? (or some other HTTP Client)
I had a very quick look at the Twitter Streaming API. It's interesting and challenging at the same time.
Zinc HTTP Components is a foremost a framework to deal with HTTP, with a functional client and server on top of that. Out of the box, the requested use case is not supported. But it should not be too difficult to write some loop that keeps on consuming responses and to deal with them in a streaming fashion.
Also note that you will need OAuth support, which is also a challenge (not provided out of the box, although some people have been working on it).
> Also for folks that have used STunnel and Nginx - can thay be used to tunnel longlived http connections? (since streaming api seems only be available from https url)
More information about the seaside