Created
March 24, 2014 18:48
-
-
Save scottgwald/9746577 to your computer and use it in GitHub Desktop.
glassprov for kurt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script> | |
var me; | |
function main() { | |
WS.serverConnect('ws://glassprov.media.mit.edu:8080/ws', function () { | |
// WS.say("Server connected yeah."); | |
console.log(WSRAW.getGlassID()); | |
me = WSRAW.getGlassID(); | |
console.log(me); | |
// setTimeout(function () { | |
if (me == "f8:8f:ca:25:06:bf") { | |
WS.say("It's me"); | |
} else { | |
WS.say("It's not me!"); | |
} | |
// }, 2000); | |
line_cb = function(chan, data) { | |
console.log("Got a lines object!"); | |
console.log(JSON.stringify(data)); | |
if (data.glassID == me) { | |
WS.wake(); | |
WS.activityCreate(); | |
WS.displayCardTree(); | |
var tree = new WS.Cards(); | |
tree.add(data.text, 'GlassProv'); | |
WS.cardTree(tree); | |
//console.log("It's me! And the text is: " + data.text); | |
//WS.say(data.text); | |
} else { | |
console.log("It's not me. But the text is: " + data.text); | |
} | |
} | |
vid_cb = function(chan, data) { | |
console.log("Got a vids object!"); | |
console.log(JSON.stringify(data)); | |
if (data.glassID == me) { | |
WS.wake(); | |
WS.activityCreate(); | |
WS.displayCardTree(); | |
var tree = new WS.Cards(); | |
tree.add(data.url, 'GlassProv'); | |
WS.cardTree(tree); | |
//console.log("It's me! And the text is: " + data.text); | |
//WS.say(data.text); | |
} else { | |
console.log("It's not me. But the text is: " + data.url); | |
} | |
} | |
WS.subscribe('lines:' + me, line_cb); | |
WS.subscribe('lines', line_cb); | |
WS.subscribe('videos:' + me, vid_cb ); | |
}); | |
} | |
window.onload = main; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment