-2

with node.js I run this code:

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('USDT_BTC', marketEvent);

}

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

connection.open();

and reseve via push-API JSON-Data:

[ { type: 'orderBookModify',
    data: { type: 'bid', rate: '2357.77000002', amount: '0.82956965' } } ]

now I want to work with the data, is it possible to store it into mysql or declare a variable with just a sequence of the JSON-Array?

NikosTikos
  • 1
  • 1
  • 4

1 Answers1

0

you can use JSON.stringify to convert the JSON into string and then save it into MySQL. However, I am not sure about what you meant by a sequence of the JSON-Array

Ashwin K Joseph
  • 371
  • 2
  • 4
  • 14