gnu-social/plugins/Orbited/orbitedupdater.js
2009-10-04 04:05:40 -04:00

25 lines
614 B
JavaScript

// Update the local timeline from a Orbited server
var OrbitedUpdater = function()
{
return {
init: function(server, port, timeline, username, password)
{
// set up stomp client.
stomp = new STOMPClient();
stomp.onmessageframe = function(frame) {
RealtimeUpdate.receive(JSON.parse(frame.body));
};
stomp.onconnectedframe = function() {
stomp.subscribe(timeline);
}
stomp.connect(server, port, username, password);
}
}
}();