diff options
Diffstat (limited to 'plugins/Orbited/orbitedupdater.js')
-rw-r--r-- | plugins/Orbited/orbitedupdater.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/Orbited/orbitedupdater.js b/plugins/Orbited/orbitedupdater.js new file mode 100644 index 000000000..8c5ab3b73 --- /dev/null +++ b/plugins/Orbited/orbitedupdater.js @@ -0,0 +1,24 @@ +// 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); + } + } +}(); + |