nyEvent::Handle;
use Protocol::WebSocket::Handshake::Client;
use Protocol::WebSocket::Frame;
use JSON;
use URI;
use Data::Dumper;
use constant VERBOSE => 1;
use constant DEBUG => 0;
use constant
to move and rewrite into your own module.
# within these subroutines you will have access to the json response in a hash format.
sub trade {
my $self = shift;
my $data = shift;
warn Data
my $msg = $self->frame->next) {
my $d;
eval {
$d = $self->json->decode($msg);
} or do {
my $e = $@;
warn $self->now