开发者

Using Google's Channel API with Twitters Streaming API

I'm trying to use Google's App Engine with Twitter's streaming API (using twitter4j) to make an application where I can type in a word and it will display the tweets with that word in 'real time' on the page.

I already have a lot of Java code to deal with the tweets, and I'm trying to put my code on the App Engine. I'm guessing the best way to do this would 开发者_开发知识库be with Google's ChannelAPI. Is that right?

I understand that twitter4j creates a thread to handle the tweets that come through, and GAE doesn't support threads like this.

Is it possible to have the server push tweets to the client as they become available, like with Comet?

I've been searching for ages trying to find some relevant guides but haven't yet found any. So if anyone knows any, that would be great.


According to this twitter4j blog post, twitter4j is compatible with Google App Engine. I suggest you make sure you're using the version 2.0.1 linked from that blog post.

You are also correct that Google App Engine doesn't support threads.

For the real-time component, you should also look at this ChannelAPI Demo. It shows how the ChannelAPI can basically push information from the server to the client.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜