= shift;
my $url = sprintf('https://www.viaf.org/viaf/search?query=%s&httpAccept=application/json', $self->query);
my $response = $self->client->get($url);
if (!$response->is_success) {
fid => $id);
return $api_id->result;
}
sub parse {
my ($self, $response) = @_;
my $parser = Catmandu::VIAF::API::Parse->new(items => $response);
return $parser->json();
}
1;
__END__
>
=item *
L<Digest::MD5>
=item *
L<HTML::Entities> 3.69
=item *
L<HTML::Parser>
=item *
L<JSON::MaybeXS> 1.003003
=item *
L<Moo>
=item *
L<PPI::HTML> 1.07
Devel::Cover lets you optionally
=encoding utf8
=head1 NAME
JSON::Tiny - Minimalistic JSON. No dependencies.
=head1 SYNOPSIS
use JSON::Tiny qw(decode_json encode_json);
my $bytes = encode_json {foo => [1, 2], bar => 'hello
!', baz => \1};
my $hash = decode_json $bytes;
=head1 DESCRIPTION
L<JSON::Tiny> is a minimalistic standalone adaptation of L<Mojo::JSON>, from
the L<Mojolicious> framework. It is a single-source-
r bundling or inlining. Along with
L<Mojo::JSON>, it is among the fastest pure-Perl implementations of
L<RFC 7159|http://tools.ietf.org/html/rfc7159>.
L<JSON::Tiny> supports normal Perl data types li
lues of your whole Moose-based project from a single config file
=head1 SYNOPSIS
# /my_conf.json:
"My::Bottle": {
"label": {
"logo": {
"c
use this package to set path to config
MooseX::ConfigCascade::Util->path(
'/my_conf.json'
);
$logo = My::Logo->new;
say $logo->company_name; # Now this
or JSON. If the file starts with a dash (-) it is assumed to be YAML and will be read in using the L<YAML> CPAN module. If it begins with an opening curly bracket ({) then it is assumed to be JSON an
nlinePayment::HTTPS;
use vars qw(@ISA $me $DEBUG);
use URI::Escape;
use HTTP::Tiny;
use JSON qw(to_json from_json);
use Business::CreditCard qw(cardtype);
use Data::Dumper;
use Carp qw(croak);
use Log
my $page = $self->_do_put_request( 'void', $post_data );
my $response = $page->{'content_json'};
$self->is_success($response->{'respstat'} eq 'A' ? $response : undef);
$self->result_
my $page = $self->_do_put_request( 'capture', $post_data );
my $response = $page->{'content_json'};
$self->is_success($response->{'respstat'} eq 'A' ? $response : undef);
$self->result_
STATISTICS => 'statistics',
TEXT => 'text',
JSON => 'json',
XML => 'xml',
CLOSURE_COMPILER_SERVICE=>'https://clos
utput_info = qw(COMPILED_CODE WARNINGS ERRORS STATISTICS);
my @output_format = qw(TEXT JSON XML);
my @warning_level = qw(QUIET DEFAULT VERBOSE);
require Exporter;
our @ISA = qw(Export
e output in XML format with the information set with your output_info settings.
- JSON
return the output in JSON format with the information set with your output_info settings.
See L<http://code
package Catmandu::Store::Datahub::OAuth;
use LWP::UserAgent;
use JSON;
use Moo;
use Catmandu::Sane;
has url => (is => 'ro', required => 1);
has username => (is => 'ro', required => 1);
has passwor
_success) {
my $token_raw = $response->decoded_content;
my $token_parsed = decode_json($token_raw);
return $token_parsed->{'access_token'};
} else {
Catmandu::HTTPE
package SSH::RPC::Shell;
$SSH::RPC::Shell::VERSION = '1.204';
use strict;
use JSON;
=head1 NAME
SSH::RPC::Shell - The shell, or server side, of an RPC call over SSH.
=head1 VERSION
version 1.204
=cut
sub run {
my $class = shift;
my $json = JSON->new->utf8;
my $request;
while (my $line = <STDIN>) {
$request = eval {$json->incr_parse($line)};
if ($@) {
quest($request);
$result->{version} = $SSH::RPC::Shell::VERSION;
my $encodedResult = eval{JSON->new->pretty->utf8->encode($result)};
if ($@) {
print { "error" => "Malformed respons
'warnings' => 0,
'FileHandle' => '2.02',
'File::Basename' => '2.84',
'JSON' => '2.94',
'Cwd' => '3.39_02',
'Data::Structure::Util' => '0.16'
},
(
0.001001';
use strict;
use warnings;
use utf8;
use Cwd;
use FileHandle;
use File::Basename;
use JSON -convert_blessed_universally;
use Data::Structure::Util qw(unbless);
use open ':encoding(utf8)';
my $json_string;
unbless $self;
delete $self->{'project'}; # delete the project from origin data
$json_string = to_json($self,{allow_blessed=>1,convert_blessed=>1}); # convert object to json
open(my $fh, '>', "$dst_dir/project_mutable.json");
print $fh $json_string;
close $fh;
unlink "$dst_dir/project.pbxproj"; # remvoe the origin project.pbxproj file
# file handle
system("/usr
STATISTICS eq 'statistics','STATISTICS imported');
ok(TEXT eq 'text','TEXT imported');
ok(JSON eq 'json','JSON imported');
ok(XML eq 'xml','XML imported');
ok(QUIET eq 'QUIET','QUIET imported');
ok(DE
package Catmandu::Store::Datahub::API;
use strict;
use warnings;
use Catmandu;
use Moo;
use JSON;
use LWP::UserAgent;
has url => (is => 'ro', required => 1);
has client_id => (is =>
($response->is_success) {
return decode_json($response->decoded_content);
} elsif ($response->code == 401) {
my $error = decode_json($response->decoded_content);
if ($error
} elsif ($response->code == 404) {
return {};
} else {
my $message = decode_json($response->decoded_content);
Catmandu::HTTPError->throw({
code =>
l = %App::dbinfo::arg_detail;
sub __json_encode {
state $json = do {
require JSON::MaybeXS;
JSON::MaybeXS->new->canonical(1);
};
$json->encode(shift);
}
sub _connect {
W::API::Bitfinex::Positions;
use WWW::API::Bitfinex::Margin;
use WWW::API::Bitfinex::Wallet;
use JSON::XS;
use Digest::SHA 'hmac_sha384_hex';
use MIME::Base64 'encode_base64';
use Data::Dumper;
has
= $args->{$_} } keys %{$args};
print Dumper encode_json($params) if $self->debug;
my $payload = encode_base64(encode_json($params), '');
my $sha384 = hmac_sha384_hex($payload,$
->res->json;
}
=head2 Public call
=cut
sub Public {
my $self = shift;
my $url = shift;
$url = $self->baseurl.'/'.$self->apiver.'/'.$url;
$self->UA->get($url)->res->json;
}
su
our $VERSION = '0.007'; # VERSION
use Carp;
use utf8;
use Net::HTTP::Spore::Middleware::Format::JSON;
use Net::HTTP::Spore 0.08;
use Net::HTTP::Spore::Middleware::DefaultParams;
use File::ShareDir '
ARGV[0] // 'Kronenplatz');
my @entries = $stop->departures;
Data::Visitor::Callback->new('JSON::PP::Boolean' => sub { $_ = $_ ? 'true' : 0 })->visit(@entries);
my $departure_table = Tabula
= Net::HTTP::Spore->new_from_spec(dist_file 'WebService-KVV-Live-Stop', 'kvvlive.json');
$client->enable('Format::JSON');
$client->enable('DefaultParams', default_params => { key => '377d840e54b59adb
_package);
use Time::HiRes qw(usleep);
use Catmandu::Sane;
use Catmandu::Store::Datahub::API;
use JSON;
with 'Catmandu::Bag';
has api => (is => 'lazy');
sub _build_api {
my $self = shift;
m
put_info=>[COMPILED_CODE,STATISTICS,WARNINGS],output_format=>JSON,warnings=>VERBOSE);
diag('testing multiple output_info settings with json as output format and warnings set to VERBOSE');
ok($ret=~m/"
strict;
use Class::InsideOut qw(readonly private id register);
use Scalar::Util qw(blessed);
use JSON;
use Net::OpenSSH;
use SSH::RPC::Result;
=head1 NAME
SSH::RPC::Client - The requestor, or clien
assing and receiving complex data structures. The arguments and return values are serialized into JSON allowing shells to be written in languages other than Perl.
=head1 METHODS
The following method
reference, or array reference.
=cut
sub run {
my ($self, $command, $args) = @_;
my $json = JSON->new->utf8->pretty->encode({
command => $command,
args => $args,
}
d1 METHODS
=over 4
=cut
package AtteanX::Endpoint {
use Moo;
use Attean;
use TryCatch;
use JSON;
use Encode;
use Plack::Request;
use Plack::Response;
use Scalar::Util qw(blessed refaddr);
ication/json-problem', 0.99, 'application/json-problem'],
);
my $headers = $req->headers;
my $stype = choose( \@variants, $headers ) || 'text/plain';
if ($stype eq 'application/json-proble
m') {
$resp->headers->content_type( 'application/json-problem' );
$resp->status($code);
my $content = encode_json($error);
$resp->body($content);
} else {
$resp->headers->conten
::Validator;
use App::Office::CMS::Database;
use App::Office::CMS::View;
use Data::Session;
use JSON::XS;
use Text::Xslate;
# We don't use Moo because we ias CGI::Application.
our $VERSION = '0.9