er
keepalive => 0,
frame_format => 'json',
## for a saftpresse (Log::Saftpresse) server
# keepalive => 1, # or 0
# frame_format => 'json',
## for a lumberjack (v1) server
#
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
age HTML::ValidationRules::Legacy;
use strict;
use warnings;
use Mojo::Base 'Exporter';
use Mojo::JSON;
use Mojo::Util qw{decode};
use Mojo::Parameters;
use Scalar::Util qw(blessed);
our @EXPORT_OK =
io' || exists $tag->attr->{checked})) {
$props->{$name}->{$TERM_REQUIRED} = Mojo::JSON->true;
}
}
if (exists $tag->attr->{maxlength}) {
}
});
return {
$TERM_PROPERTIES => $props,
$TERM_ADD_PROPS => Mojo::JSON->false,
};
}
sub validate {
my ($schema, $params, $charset) = @_;
if (! (blesse
rics within any event-driven Perl application, as well as the
reporting of those statistics via a JSON-over-HTTP API for consumption by
external systems monitoring tools.
Using Monitor::MetricsAPI fi
IPTION
Jq is a data language for querying and manipulating JSON data. It takes JSON
as input; queries and manipulates; and then prints JSON as output.
Jq.pm is a Perl module binding to Jq. It's inpu
ts and outputs are Perl data
abjects that can be represented as JSON.
=head1 STATUS
The current version of Jq uses IPC::Run to invoke your local C<jq> binary.
This is an API compatible workaround un
use strict;
use warnings;
use 5.008;
use LWP::Simple;
use LWP::UserAgent;
use Carp;
use JSON qw(decode_json);
# Freesound.org urls.
#
our %urls = (
'base' => 'https://www.freesound.org
can then be used as inputs to C<$freesound->query> -
the output formatted into HTML (from XML or json) as you
wish. With Freesound you get a picture of the waveform and a low quality sound preview s
le exists.
#
if ( -s $self->session_file ) {
# Read the session file and get its json auth tokens.
#
open my $fh, '<', $self->session_file
or croak
d;
use Net::Lumberjack::Frame::Ack;
use Net::Lumberjack::Frame::Data;
use Net::Lumberjack::Frame::JSON;
has 'version' => ( is => 'rw', isa => 'Int', default => 1 );
has 'type' => ( is => 'rw', isa =>
YPES = (
'A' => 'Ack',
'W' => 'WindowSize',
'C' => 'Compressed',
'D' => 'Data',
'J' => 'JSON',
);
sub new_from_fh {
my ( $class, $fh ) = ( shift, shift );
my ( $version, $type );
# EOF
use Net::Lumberjack::Frame;
use Net::Lumberjack::Frame::WindowSize;
use Net::Lumberjack::Frame::JSON;
use Net::Lumberjack::Frame::Compressed;
has 'handle' => ( is => 'ro', required => 1 );
has 'se
isa => 'Str', default => 'json');
has '_frame_class' => (
is => 'ro', isa => 'Str', lazy => 1,
default => sub {
my $self = shift;
if( $self->frame_format eq 'json' || $self->frame_format e
q 'v2' ) {
return "Net::Lumberjack::Frame::JSON";
} elsif( $self->frame_format eq 'data' || $self->frame_format eq 'v1' ) {
return "Net::Lumberjack::Frame::Data";
} else {
di
Mojo::Base 'Mojolicious::Plugin';
our $VERSION = '0.03';
use Data::Dumper;
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Util qw{encode decode xml_escape hmac_sha1_sum secure_compare
charset, $html);
}
sub serialize {
return b64_encode(encode_json(shift // return), '');
}
sub deserialize {
return decode_json(b64_decode(shift // return));
}
sub sign {
my ($value, $se
uilder::WebApi::Object::Transform;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Date::
# return perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
f
deserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
use 5.010;
use strict;
use warnings;
use HTTP::Request::Common;
require LWP::UserAgent;
require JSON;
require Carp;
our $VERSION = '1.03';
sub new {
my $class = shift;
my $self = bless {@
f->{secret} && $self->{postback});
$self->{ua} ||= LWP::UserAgent->new();
$self->{json} ||= JSON->new;
return $self;
}
sub authorize {
my ($self, $params) = @_;
my %params;
d_content unless $response->is_success;
return $response->content if $raw;
return $self->{json}->decode($response->content);
}
sub request_data {
my ( $self, $params ) = @_;
my %para
r' => '/folder/full/of/json/files',
'extend_with' => ['Store::Dir', 'Value::InfDef'],
'inflate' => sub { JSON::Util->decode($_[0]) },
'deflate' => sub { JSON::Util->encode($_[0]) },
);
my %data = %{$dk->get('abcd.json')};
$dk->set('abcd.json', \%data);
=head1 WARNING
experimental, use at your own risk :-)
=head1 DESCRIPTION
L<Data::Keys> is just a base class module that pu
package Net::Marathon::Group;
use strict;
use warnings;
use parent 'Net::Marathon::Remote';
use JSON::XS;
sub new {
my ($class, $conf, $parent) = @_;
my $self = bless {};
$conf = {} unle
/v2/groups', $self->get_updateable_values);
if ( $response ) {
$self->version( decode_json($response)->{version} );
return $self;
}
return undef;
}
sub update {
my ($
f->id . $self->_uri_args($args), $payload);
if ( $response ) {
$self->version( decode_json($response)->{version} );
return $self;
}
return undef;
}
sub delete {
my ($
package Net::Marathon;
use 5.006;
use strict;
use warnings;
use LWP::UserAgent;
use JSON::XS;
use Net::Marathon::App;
use Net::Marathon::Group;
use Net::Marathon::Events;
use Net::Marathon::Deploymen
tp://mesosphere.github.io/marathon/docs/rest-api.html), so it can be used without having to write JSON by hand.
For the most common tasks, there is a helper method in the main module. Some additional
( $status ) {
$status = '?status='.$status;
}
my $task_obj = $self->_get_obj_from_json('/v2/tasks'.$status);
my $task_arrayref = ( defined $task_obj && exists $task_obj->{tasks} &&
lder::WebApi::Object::QueryColumn;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Date::
# return perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
f
deserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
2::Serializer::JSONMaybeXS;
use Moo;
use JSON::MaybeXS ();
our $VERSION = '0.003';
with 'Dancer2::Core::Role::Serializer';
has '+content_type' => ( default => sub {'application/json;charset=UTF-8'
} );
sub BUILD {
warnings::warnif('deprecated',
'Dancer2::Serializer::JSONMaybeXS is deprecated and should no longer be used');
}
sub serialize {
my ($self, $entity, $options) = @_;
my $confi
tions->{utf8};
JSON::MaybeXS->new($options)->encode($entity);
}
sub deserialize {
my ($self, $entity, $options) = @_;
$options->{utf8} = 1 if !defined $options->{utf8};
JSON::MaybeXS->new($op
e JSON;
use Exporter 'import';
our @EXPORT = qw(jq);
sub jq {
my ($filter, @data) = @_;
my @jq = ('jq', "$filter");
my ($in, $out, $err);
for my $value (@data) {
$in .= JSON:
:encode_json($value) . "\n";
}
run \@jq, \$in, \$out, \$err, timeout(10)
or die "jq: $?, $err";
my $result = JSON::decode_json("[$out]");
return wantarray ? @$result : $result
} ## end sub normalize_record
sub parse_request {
my ($self, $req) = @_;
my $data = $req->json;
return unless $data->{object} eq 'page';
local $Data::Dumper::Indent = 1;
my @updates;
arnings;
use Carp;
use LWP::UserAgent;
use HTTP::Request;
use Mozilla::CA;
use Config::Tiny;
use JSON;
use XML::Simple;
use Digest::MD5 qw( md5_base64 );
use URI::Encode qw(uri_encode uri_decode );
u
(optional) - the payload for POST updates as XML
RETURNS
The response is requested in JSON format which is then processed into a Perl structure that
is returned to the caller.
=cut
> 'application/x-www-form-urlencoded; charset=utf-8');
$req->header( 'Accept' => 'application/json');
$req->content( $access->to_post_body ) if defined $xml;
}
elsif ( $method eq 'GET' )
der::WebApi::Object::HiddenColumn;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Date::
# return perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
f
deserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
Request::Common;
use HTML::Entities;
use LWP::UserAgent;
use JSON qw( from_json to_json decode_json);
use JSON::WebToken;
use Config::JSON;
use Sysadm::Install qw( slurp );
use File::Basename;
use F
SIS
use WWW::Google::Drive;
my $gd = WWW::Google::Drive->new(
secret_json => 'YourProject.json',
# Set the Google user to impersonate.
# Your Google Business Adm
ret json file.
Refer: https://developers.google.com/drive/v3/reference/ for list of file properties, response values, query_params and body_params.
=head1 METHODS
=over 4
=cut
has secret_json