summaryrefslogtreecommitdiff
path: root/plugins/Orbited/orbitedupdater.js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-04 03:02:04 -0400
committerEvan Prodromou <evan@status.net>2009-10-04 03:15:59 -0400
commit035978270d609b650b8e32f252366e0e75b12507 (patch)
tree5d49a7fd92f376c110e27e1950ec288c1c04cadf /plugins/Orbited/orbitedupdater.js
parent9c2d0879e9064fe3b9cf9af2c7eabe869966bd92 (diff)
Update OrbitedPlugin to work with RealtimePlugin framework
Diffstat (limited to 'plugins/Orbited/orbitedupdater.js')
-rw-r--r--plugins/Orbited/orbitedupdater.js21
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));
+ };
+ };
+ }
+}();
+