Created
September 20, 2015 19:35
-
-
Save Anderson-Juhasc/c704c00d4cec1b491f61 to your computer and use it in GitHub Desktop.
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script> | |
<script type="text/javascript" src="bower_components/reconnecting-websocket/reconnecting-websocket.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var wsUri = 'ws://ws.blockchain.info/inv'; | |
var ws = new ReconnectingWebSocket(wsUri); | |
ws.onopen = function() { | |
console.log('open'); | |
ws.send('{"op":"addr_sub", "addr":"12B56bYzPBdoG62dAzbsxMwzym22jcRCs6"}'); | |
} | |
ws.onclose = function() { | |
console.log('close'); | |
} | |
ws.onerror = function(error) { | |
console.log('websocket error: ' + error); | |
} | |
ws.onmessage = function(e) { | |
console.log(e); | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<img src="https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=L|0&chl=bitcoin:12B56bYzPBdoG62dAzbsxMwzym22jcRCs6" alt="" /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment