有没有通过HTML5 webSocket API(JavaScript)连接到Twitter的方法?Twitter + HTML5 webSocket API
目前http://streamie.org/似乎正在做这样的事情,但他们正在领导它通过http://local.streamie.org:8888/所以它看起来像他们正在运行websocket。
JavaScript的部分是相当清楚的:
websocket = new WebSocket('ws://echo.websocket.org/');
websocket.onopen = function(event) {
websocket.send('hello from client');
console.log('CONNECTED');
};
websocket.onclose = function(event) {
console.log('DISCONNECTED');
};
websocket.onmessage = function(event) {
console.log(event.data);
};
websocket.onerror = function(event) {
};
但是,什么是WebSocket的地址Twitter的?
谢谢。有没有这样的服务为你运行? – DADU 2011-03-16 03:27:53
我知道[Superfeedr支持WebSockets](http://blog.superfeedr.com/websockets-and-comet/),所以你可以根据他们是否有你需要的Twitter数据来使用它们。您可能也可以使用[DataSift的WebSocket API](http://support.datasift.net/help/kb/streaming-api/websocket-streaming)。 – abraham 2011-03-16 07:04:45
我认为DataSift的WebSocket API正是我们需要的。谢谢。 – DADU 2011-03-16 16:38:17