Connecting to Blockchain websocket

I'm trying to connect to the Blockchain websocket API (https://blockchain.info/api/api_websocket), since I have no idea where to start except for processing.net, I quickly modified the clientEvent() example to this:

import processing.net.*;

Client myClient;

void setup() {
  size(200, 200);
  myClient = new Client(this, "ws://ws.blockchain.info/inv", 8335);
}

void draw() { }

void clientEvent(Client someClient) {
  println(myClient.read());
}

This throws an error, but I'm not sure why. Anyone knows what's wrong and (more importantly) how to connect to the Blockchain web socket API?

Thanks :-)

Answers

Sign In or Register to comment.