qw(all);
use JSON;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use HTML::Linear::Path::Colors;
## no critic (ProhibitPackageVars)
our $VERSION = '0.019'; # VERSION
has json => (
is => 'ro',
isa => InstanceOf['JSON'],
default => sub { JSON->new->ascii->canonical },
lazy => 1,
);
has address => (is => 'rw', isa => Str, required =
$ref->{attr} = $self->attributes if keys %{$self->attributes};
return $self->key($self->json->encode($ref));
}
sub as_xpath {
my ($self, $strict) = @_;
my $xpath = _wrap(separator
Class::Schema::Loader
DB_File
Daemon::Generic
Data::DPath
Data::Float
Data::Printer::Filter::JSON
Data::Printer::Filter::URI
DateTime::Format::ISO8601
DateTime::Format::Strptime
Devel::NYTPro
use LWP::UserAgent;
use English '-no_match_vars';
use HTTP::Request::Common qw(POST);
use JSON qw(decode_json);
use File::Temp;
use File::HomeDir;
use Cwd;
use Scope::Guard;
use Ukigumo::Constants;
to @{[ $self->server_url ]}/api/v1/report/add:\n" . $res->as_string;
my $dat = eval { decode_json($res->decoded_content) } || $res->decoded_content . " : $@";
$self->logger->infof("report url
package WebService::SwigClient;
use Moo;
our $VERSION = '0.001';
use JSON::XS qw(encode_json);
use WWW::Curl::Easy;
has api_key => ( required => 0, is => 'rw' );
has service_url => ( required =
->setopt(CURLOPT_POST, 1);
$render_curl->setopt(CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
return $render_curl;
});
has error_handler => ( is => 'rw' );
{
my $singleton;
sub in
ncode_json($data));
}
sub create_template {
my ($self, $filename, $data) = @_;
my $url = join('/',($self->service_url, $self->api_key, $filename));
return $self->post($url, encode_json($data
a and Kanbanize sync tool
use Data::Dumper;
use Net::Bugzilla::Kanbanize;
use LWP::Simple;
use JSON;
use LWP::UserAgent;
use File::HomeDir;
use HTTP::Request;
use URI::Escape;
use List::MoreUtils
res->is_success ) {
die Dumper($res); #$res->status_line;
}
my $data = decode_json( $res->decoded_content );
my %bugs;
foreach my $bug ( @{ $data->{bugs} } ) {
$b
res->is_success ) {
die Dumper($res); #$res->status_line;
}
my $data = decode_json( $res->decoded_content );
my @found_bugs = @{ $data->{bugs} };
foreach my $bug ( sort @
package Net::Docker;
use strict;
use 5.010;
our $VERSION = '0.002005';
use Moo;
use JSON;
use URI;
use URI::QueryParam;
use LWP::UserAgent;
use Carp;
use AnyEvent;
use AnyEvent::Socket 'tcp_connect';
tent_type eq 'application/json') {
return decode_json($res->decoded_content);
}
elsif ($res->content_type eq 'text/plain') {
return eval { decode_json($res->decoded_content) };
my ($self, $res) = @_;
if ($res->content_type eq 'application/json') {
my $json = JSON::XS->new;
return $json->incr_parse($res->decoded_content);
}
my $message = $res->d
store
$ echo '{"_id":"001",hello":"world"}' | catmandu import JSON to test
$ echo '{"_id":"001",hello":"world2"}' | catmandu import JSON to test
# In the store we see only the latest version
$ c
orter('Foo', file => "/tmp/output.txt");
# Or on the command line
$ catmandu convert JSON to Foo < /tmp/something.txt >/tmp/output.txt
=head1 DESCRIPTION
A Catmandu::Exporter is a Perl
atmandu::Exporter.
=head2 log
Returns the current logger.
=head1 SEE ALSO
L<Catmandu::Addable>, L<Catmandu::Fix>,L<Catmandu::JSON>,
L<Catmandu::YAML>, L<Catmandu::CSV>, L<Catmandu::RIS>
=cut
1;
ex::API::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/trades.json';
use constant ATTRIBUTES => qw(currencypair days startdate enddate);
use constant DATA_KEY =>
data:
plugins:
- Datestamps
$ echo '{"hello":"world"}' | catmandu import JSON to test
$ catmandu export test to YAML
---
_id: ADA305D8-697D-11E3-B0C3-97AD572FA7E3
date_cre
Handle::Util ();
use File::Spec;
use YAML::XS ();
use JSON ();
our %EXPORT_TAGS = (
io => [qw(io read_file write_file read_yaml read_json join_path
normalize_path segmented_path)],
# dies on error
YAML::XS::LoadFile($_[0]);
}
sub read_json {
my $text = read_file($_[0]);
# dies on error
JSON::decode_json(read_file($_[0]));
}
sub join_path {
my $path = File:
ng the YAML.
=item read_json($path);
Reads the JSON file at C<$path> into a Perl hash.
my $cfg = read_json($path);
Dies on failure reading the file or parsing the JSON.
=item join_path(@path)
ious::Plugin::SessionCompress;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::Util ();
use Mojo::JSON ();
use Compress::Zlib ();
our $VERSION = '0.03';
sub register {
my ($self, $app, $conf) = @_
rialize = delete $conf->{deserialize};
} else {
$serialize = \&Mojo::JSON::encode_json;
$deserialize = \&Mojo::JSON::j;
}
$app->sessions->serialize(sub {
my $hashref = shift;
m
$inflated;
}
=head2 C<serialize>
serialize => \&Mojo::JSON::encode_json
=head2 C<deserialze>
deserialize > \&Mojo::JSON::j
=head2 C<min_size>
min_size minimum size that's allowe
Carp qw(confess);
use Log::Log4perl qw(:easy);
use REST::Client;
use URI::Template;
use JSON;
my $json = JSON->new->allow_nonref;
=head1 NAME
Usergrid::Request - Role that provides HTTP invocation
er('Authorization',
'Bearer ' . $self->user_token->{'access_token'});
}
my $json_req = $self->json_encode($request) if ($request);
$client->DELETE($resource) if ($method eq 'D
rce) if ($method eq 'GET');
$client->POST($resource, $json_req) if ($method eq 'POST');
$client->PUT($resource, $json_req) if ($method eq 'PUT');
my $response = $client->responseCo
::API::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/withdraw.json';
use constant ATTRIBUTES => qw(amount currency address);
sub amount { my $self = shift; $self
(-no_match_vars);
use File::Path;
use File::Spec::Functions;
use File::Temp;
use File::chdir;
use JSON;
use Params::Validate qw(:all);
use Scalar::Util qw(weaken);
use URI;
use URI::Escape;
use base
us $status" );
}
);
my %read_req;
%read_req = (
# read one json item at a time
json => sub {
my ( $h, $data ) = @_;
# every successful read resets slee
w, must specify a valid git revision";
}
my $data = $options->{reviewInput};
my $jsondata = encode_json($data);
my $url = join('/',
$options->{http_url},
'a',
'changes',
uri
d_serializer',
handles => [qw(serialize deserialize)]
);
sub default_serialization_format { 'json' }
sub _build_serializer {
my ($self) = @_;
my $pkg = require_package($self->serializati
Catmandu::Env;
use Catmandu::Sane;
use Catmandu::Util qw(require_package use_lib read_yaml read_json :is :check);
use Catmandu::Fix;
use Config::Onion;
use File::Spec;
use Moo;
require Catmandu;
use
f
grep { -f File::Spec->catfile($path, $_) }
grep /^catmandu.+(?:yaml|yml|json|pl)$/,
readdir $dh;
}
Catmandu->default_load_path;
}
has load_paths => (
as default_importer_package => (is => 'ro', default => sub { 'JSON' });
has default_exporter_package => (is => 'ro', default => sub { 'JSON' });
has store_namespace => (is => 'ro', default => sub { '
andu::Iterable> for all inherited methods.
=head1 SEE ALSO
L<Catmandu::Iterable> , L<Catmandu::Fix> ,
L<Catmandu::Importer::CSV>, L<Catmandu::Importer::JSON> , L<Catmandu::Importer::YAML>
=cut
1;
[ "verbose|v", "" ],
);
}
sub description {
<<EOS;
examples:
cat books.json | catmandu convert JSON to CSV --fields id,title
options:
EOS
}
sub command {
my ($self, $opts, $args)
I::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/transactions.json';
use constant ATTRIBUTES => qw(currencypair days startdate enddate);
use constant DATA_KEY =>