views:

381

answers:

2

The Twitter streaming api says that we should open a HTTP request and parse updates as they come in. I was under the impression that Google's urlfetch cannot keep the http request open past 10 seconds.

I considered having a cron job that polled my Twitter account every few seconds, but I think Google AppEngine only allows cron jobs once a minute. However, my application needs near-realtime access to my twitter @replies (preferably only a 10 second or less lag).

Are there any method for receiving real-time updates from Twitter?

Thanks!

A: 

I'm curious.

Wouldn't you want this to be polling twitter on the client side? Are you polling your public feed? If so, I would decentralize the work to the clients rather than the server...

John Weldon
I actually want to do some processing of the updates server-side (end-user specific filtering), so client-side polling wouldn't work. Thanks though!
ehfeng
Ah, makes sense.
John Weldon
+1  A: 

Unfortunately, you can't use the urlfetch API for 'hanging gets'. All the data will be returned when the request terminates, so even if you could hold it open arbitrarily long, it wouldn't do you much good.

Have you considered using Gnip? They provide a push-based 'web hooks' notification system for many public feeds, including Twitter's public timeline.

Nick Johnson
Gnip is "Re-Launching Februaru 2010". Are there other services that would do this?
dfrankow
None that I'm aware of, currently. :(
Nick Johnson