Created
March 21, 2015 17:16
-
-
Save soemarko/0ae85d5236eaea2e76c5 to your computer and use it in GitHub Desktop.
Spark Debugger
This file contains 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
<!DOCTYPE html> | |
<html> | |
<script> | |
var source = new EventSource('https://api.spark.io/v1/devices/[DEVICE_ID]/events/?access_token=[ACCESS_TOKEN]'); | |
source.addEventListener('logger', function(e) { | |
var p = document.createElement('p'); | |
var d = JSON.parse(e.data); | |
p.innerHTML = d.data; | |
document.body.insertBefore(p, document.body.firstChild); | |
}, false); | |
</script> | |
<style> | |
body {font-family: "Helvetica-Neue", helvetica} | |
</style> | |
<head> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment