diff options
Diffstat (limited to 'plugins/Orbited/orbitedupdater.js')
-rw-r--r-- | plugins/Orbited/orbitedupdater.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/Orbited/orbitedupdater.js b/plugins/Orbited/orbitedupdater.js new file mode 100644 index 000000000..d70f4a4fd --- /dev/null +++ b/plugins/Orbited/orbitedupdater.js @@ -0,0 +1,21 @@ +// 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.connect(server, port, username, password); + stomp.subscribe(timeline); + + stomp.onmessageframe = function(frame) { + RealtimeUpdate.receive(JSON.parse(frame.body)); + }; + }; + } +}(); + |