pace::clean;
use AnyEvent::HTTP::MultiGet;
use AnyEvent::WebSocket::Client;
use MIME::Base64;
use JSON;
use AnyEvent::HTTP::Spark;
BEGIN {
no namespace::clean;
with 'HTTP::MultiGet::Role', 'AnyE
$obj->agent->run_next;
AnyEvent::Loop::run;
sub cb {
my ($sb,$result,$eventType,$verb,$json)=@_;
return unless $eventType eq 'conversation.activity' and $verb eq 'post';
# Data::Re
,
);
has lastConn=>(
isa=>Str,
is=>'ro',
required=>1,
default=>'/tmp/sparkBotLastConnect.json',
);
has connection=>(
is=>'rw',
isa=>Object,
required=>0,
);
has on_message=>(
is=>'ro
Modern::Perl;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use Data::Dumper;
use JSON qw(to_json from_json);
use HTTP::Request::Common qw(POST);
use Ref::Util qw(is_plain_arrayref is_plain_hash
e("${method}Id is a requried argument")) unless defined($targetId);
return $self->que_put_json($cb,"$path/$targetId",$data);
};
} elsif($method eq 'get') {
$code=sub {
eq 'create') {
$code=sub {
my ($self,$cb,$data)=@_;
return $self->que_post_json($cb,"$path",$data);
};
} else {
die "Er um.. $method isn't supported yet";
}
=>'Bearer ' .$self->token);
$h->header('Content-Type', 'application/json; charset=UTF-8');
$h->header(Accept=>'application/json');
return $h;
}
=back
=head1 AUTHOR
Michael Shipper <AKALINUX@C