}
my $addendum = '';
foreach my $arg (@args) {
$addendum .= '_paq.push(' . to_json($arg) . ");\n";
}
my $js = <<"JAVASCRIPT";
<script type="text/javascript">
var _paq =
sub run
{
my $self = shift;
my ( $opts ) = @_;
my $token;
repeat {
$self->do_json( GET => "/_matrix/client/r0/sync",
params => {
timeout => 30*1000,
if( defined $token or $opts->{initial} ) {
print "---\n";
print $self->JSON_pretty->encode( $body );
}
$token = $body->{next_batch};
Future->done
r $VERSION = '1.6'; # VERSION
use JSON;
extends 'Log::Saftpresse::Input::Command';
has 'command' => ( is => 'ro', isa => 'Str', default => 'journalctl -f -o json');
has 'lowercase' => ( is => 'ro
isa => 'Bool', default => 1 );
sub process_line {
my ( $self, $line ) = @_;
my $data = from_json( $line );
if( $self->lowercase ) {
my %new = map { lc $_ => $data->{$_} } keys %$data;
server
our $VERSION = '1.6'; # VERSION
extends 'Log::Saftpresse::Output';
use Redis;
use JSON qw(encode_json);
has 'server' => ( is => 'ro', isa => 'Str',
default => '127.0.0.1:6379'
);
has 'soc
$output{'@timestamp'} = $output{'time'}->datetime;
delete $output{'time'};
}
encode_json(\%output)
} @events;
$self->_redis->lpush($self->queue, @blobs);
return;
}
1;
__END__
=po
socket"
db = 0
queue = "logs"
</Input>
=head1 Format
The plugin will write entries in JSON format.
=head1 AUTHOR
Markus Benning <ich@markusbenning.de>
=head1 COPYRIGHT AND LICENSE
This
die "Type not specified and could not guess it from the filename\n";
}
$self->do_json( POST => "/_matrix/media/r0/upload",
content => $content,
content_type => $type,
)
F', $endpoints));
% my ($endpoints) = @_;
use Mojolicious::Lite;
use Path::Tiny;
use Mojo::JSON qw(encode_json);
% foreach my $endpoint (@$endpoints) {
<%= $endpoint->method %> '<%= $endpoint->path %
b {
my ($c) = @_;
path(app->home(), "<%= $endpoint->path_as_filename %>")->append(encode_json($c->req->body)."\n");
$c->render(%{<%= $endpoint->render_as_string %>});
};
% }
any '/app_m
;
use strict;
use Eixo::Base::Clase;
use URI;
use LWP::UserAgent;
use LWP::Protocol::https;
use JSON -convert_blessed_universally;
use Carp;
use Data::Dumper;
use Config;
use Eixo::Rest::RequestSyn
my $USER_AGENT_VERSION = 'EixoAgent/0.1';
has(
ua=>undef,
endpoint=>undef,
format=>'json',
error_callback => undef,
current_method => undef,
);
sub initialize{
my ($self, $e
tent-Type')
|| 'application/json';
#|| 'application/x-www-form-urlencoded';
if($content_type eq "application/json"){
$content = JSON->new->allow_blessed(1)
Plack::Middleware::HTTPExceptions;
use Plack::Middleware::Access;
use Carp qw(croak);
use JSON qw(decode_json);
use Scalar::Util qw(blessed);
our $VERSION = '0.9';
our @GITHUB_IPS = (
allow =>
) {
$payload = $req->param('payload') || $req->content;
$payload = eval { decode_json $payload };
}
if (!$payload) {
return [400,['Content-Type'=>'text/plain','Conten
ION
This L<PSGI> application receives HTTP POST requests with body parameter
C<payload> set to a JSON object. The default use case is to receive
L<GitHub WebHooks|http://developer.github.com/webhook
ute) = @_;
return undef if(grep {$attribute eq $_} $self->NOT_SERIALIZE);
return 1;
}
sub TO_JSON {
my $self = $_[0];
return {map {$_ => $self->$_} grep {$self->is_serializable($_)} keys(%$sel
$msg = $msg->[0] if ref $msg eq 'ARRAY' && @$msg == 1;
if (eval { $msg->isa('Log::Message::JSON') }) {
$msg = { %$msg };
} elsif (eval { $msg->DOES("Log::Message::Structured") }) {
$m
ort = 5044
log4perl.appender.Remote.keepalive = 0
log4perl.appender.Remote.frame_format = json
#log4perl.appender.Remote.use_ssl = 1
#log4perl.appender.Remote.ssl_verify = 1
# thes
f frames per connection.
=head2 frame_formt (default: 'json')
The following frame formats are supported:
=over
=item 'json', 'v2'
Uses json formatted data frames as defined in lumberjack protocol
package Eixo::Rest::RequestAsync;
use strict;
use threads;
use Thread::Queue;
use JSON -convert_blessed_universally;
# use Eixo::Base::Clase;
use Eixo::Base::Clase 'Eixo::Rest::Request';
use Attr
> undef,
onSuccess => undef,
onError => undef,
onStart => undef,
__format=>'json',
buffer=>'',
);
sub start{
my ($self) = @_;
$self->{buffer} = ''; # truncate the
n/json
if($response->content_type eq 'application/json'){
use Encode;
$content = Encode::decode('UTF-8', $content);
}
if($self->__format eq 'json'){
return JSON->
ebService::Spotify;
use Moo;
use Method::Signatures;
use LWP::UserAgent;
use URI::QueryParam;
use JSON;
use Data::Dumper;
our $VERSION = '1.003';
has 'prefix' => ( is => 'rw', default => 'https://ap
$uri->as_string);
$self->_log("RESP", $response->content);
return $response->content ? from_json($response->content) : undef;
}
method post ($method, $payload, %args) {
my $uri = $self->
headers;
$headers->{'Content-Type'} = 'application/json';
my $response = $self->user_agent->post( $uri->as_string, %$headers, Content => to_json($payload) );
$self->_log("POST", $uri->as_stri
>
=back
=head1 AUTHOR
Maxim Motylkov
=head1 TODO
The closest plans are
=over 4
=item * Add json data format.
=back
=head1 MODIFICATION HISTORY
See the Changes file.
=head1 COPYRIGHT AND LIC
ackage WebService::Slack::IncomingWebHook;
use 5.008001;
use strict;
use warnings;
use utf8;
use JSON;
use Furl;
use Carp ();
our $VERSION = "0.02";
sub new {
my ($class, %args) = @_;
Carp:
{$_} ) } qw( webhook_url channel icon_emoji icon_url username )
} => $class;
$self->{json} = JSON->new->utf8;
$self->{furl} = Furl->new(agent => "$class.$VERSION");
return $self;
}
->{furl}->post(
$self->{webhook_url},
['Content-Type' => 'application/json'],
$self->{json}->encode($post_data),
);
if (! $res->is_success) {
Carp::carp('post f
package Eixo::Rest;
use 5.008;
use strict;
use warnings;
use parent qw(Eixo::Base::Clase);
use JSON;
use LWP::UserAgent;
our $VERSION = '1.207';
1;
filename);
use Test::RestAPI::MojoGenerator;
use Port::Selector;
use Path::Tiny;
use Mojo::JSON qw(decode_json);
use Mojo::UserAgent;
use constant WINDOWS => ($^O eq 'MSWin32');
BEGIN {
if (WIND
my @lines;
while (my $line = <$fh>) {
chomp $line;
push @lines, decode_json($line);
}
return \@lines;
}
sub DESTROY {
my ($self) = @_;
if ($^O eq 'MSWin3
uth2;
use Moo;
use Method::Signatures;
use IO::File;
use LWP::UserAgent;
use URI::QueryParam;
use JSON;
use MIME::Base64;
use Data::Dumper;
our $VERSION = '1.002';
has 'client_id' => ( is => 'rw
if (my $fh = IO::File->new('< ' . $self->cache_path)) {
local $/;
$token_info = from_json( <$fh> );
$fh->close;
}
$token_info = $self->refresh_access_token($token_info->{re
IO::File->new('> ' . $self->cache_path) || die "Could not create cache file $@";
print $fh to_json($token_info);
$fh->close;
}
}
method is_token_expired ($token_info) {
return ($token_inf
e::HealthGraph::Response::VERSION = '0.000004';
use Moo;
use Array::Iterator ();
use JSON::MaybeXS qw( decode_json );
use Types::Standard qw( Bool CodeRef InstanceOf Maybe Ref );
use Types::URI qw( U
my $self = shift;
my $content = $self->raw->decoded_content;
return $content ? decode_json($content) : undef;
}
sub _build_iterator {
my $self = shift;
my $content = $self->con
meta_is_normalized => 1,
common_opts => $cli->{common_opts},
per_arg_json => $cli->{per_arg_json},
per_arg_yaml => $cli->{per_arg_yaml},
);
return [500, "Can't genera
> $gengls_res,
meta => $meta,
meta_is_normalized => 1,
per_arg_json => $cli->{per_arg_json},
per_arg_yaml => $cli->{per_arg_yaml},
);
return [500, "Can't genera