javascript - How to get poloniex push API data with Wampy -
i want correct data when connect poloniex push api use wamp protocal wampy.js implementation http://wamp-proto.org/implementations/
but got last 2 data types right, first 1 keep gives me "seq":
{"seq":76722908}
["btc_eth","0.02027380","0.02027377","0.02027355","0.06151162","29539.50716156","1478656.69569076",0,"0.02097800","0.01865820"]
["trollboxmessage",8755461,"reorx2112","made mill alrdy",9]
the official example , http://pastebin.com/dmx7mze0 use autobahn node.js module
this code below
script src="node_modules/wampy/build/wampy-all.min.js> script>
<pre> ws = new wampy('wss://api.poloniex.com', {realm: "realm1"}); ws.onopen = function () { // //subscribe currency pair //this data type not correct //while other data looks normal // ws.subscribe('btc_eth',function (data) { console.log(data); document.getelementbyid("event").innerhtml=json.stringify(data); }); //only raw data ws.subscribe('ticker',function (data) { if(data[0]==="btc_eth"){ console.log(data); document.getelementbyid("ticker").innerhtml=son.stringify(data); } }); //chat box ws.subscribe('trollbox',function (data) { console.log(data); document.getelementbyid("trollbox").innerhtml=json.stringify(data); }); }; ws.onopen()</pre>
this question bugs me while......
Comments
Post a Comment