Tuesday 6 June 2017

how to put a subscribed node result to html

i've got a push API which pushes live ticker, order book, trade, and Trollbox updates over WebSockets using the WAMP protocol

   var autobahn = require('autobahn');
   var wsuri = "wss://api.poloniex.com";
   var connection = new autobahn.Connection({
       url: wsuri,
       realm: "realm1"
   });

   connection.onopen = function (session) {
    function marketEvent (args,kwargs) {
            console.log(args);
    }
    function tickerEvent (args,kwargs) {
            console.log(args);
    }
    function trollboxEvent (args,kwargs) {
            console.log(args);
    }
    session.subscribe('BTC_XMR', marketEvent);
    session.subscribe('ticker', tickerEvent);
    session.subscribe('trollbox', trollboxEvent);
    }

    connection.onclose = function () {
    console.log("Websocket connection closed");
    }

    connection.open();

how to fetch the data with php or python?



via Andrej Bardzodobry

No comments:

Post a Comment