[Seaside] Re: Zinc - Twitter - Streaming API - Long lived
andreas.raab at gmx.de
Fri Oct 21 13:00:01 UTC 2011
On 10/21/2011 10:20, Davorin Rusevljan wrote:
> Can Zinc do that? (or some other HTTP Client)
WebClient  + SqueakSSL  does it quite nicely:
| wc |
wc := WebClient new.
wc username: 'YOUR_TWITTER_USERNAME'.
wc password: 'YOUR_TWITTER_PASSWORD'.
resp := wc httpGet: 'https://stream.twitter.com/1/statuses/sample.json'.
resp isSuccess ifFalse:[^self error: 'Request failed'].
"Process incoming data"
stream := resp contentStream.
["Could also set the stream to be non-signaling, but perhaps we want
to keep track of timeouts at some point"
[stream waitForData] on: ConnectionTimedOut do:[:ignore].
stream isDataAvailable ifTrue:[
"Transcript out the next chunk of data"
Transcript show: resp nextChunk.
More information about the seaside