uccess) {
if ($response->header('content-type') eq 'application/json') {
my $content = from_json($response->decoded_content);
$error = $content->{error};
ane;
use Moo;
use Types::Standard qw( Bool );
use URI::Template;
extends 'Catmandu::Importer::getJSON';
our $AUTHORITY = 'cpan:JONASS';
our $VERSION = '0.001';
has api => (
is => 'ro',
def
',
lazy => 1,
builder => sub {
URI::Template->new( $_[0]->api . '{/topic,reference}?format=json' );
}
);
has '+from' => (
is => 'ro',
lazy => 1,
builder => \&_build_from,
);
has d
ies Parltrack for entities.
=head1 CONFIGURATION
This importer extends L<Catmandu::Importer::getJSON>, so it can be configured
with options C<agent>, C<timeout>, C<headers>, C<proxy>, and C<dry>. Ad
d from the API webpage.
For the moment the results obtained from the API are in pure HTML, XML or JSON.
=head2 Search functionalities
=head3 Search Protein
Search proteins matching the query or sea
$np->search_cv(-query => "colon", -filter => "keyword");
=head3 Format:
Output format maybe in JSON (default), HTML or XML.
@result = $np->search_protein(-query => "kinase", -filter => "disease"
_info(-query => "NX_P13051", -retrieve => "expression");
=head3 Format:
Output format maybe in JSON (default), HTML or XML.
@result = $np->get_protein_info(-query => "NX_P13051", -retrieve => "ex
uery} = undef;
$self->{_filter} = undef;
$self->{_chromosome} = undef;
$self->{_format} = "json";
bless($self, $class);
return $self;
}
sub search_protein() {
my $self = shift;
my %p
ERSION = '0.0008'; # VERSION
use HTTP::Request::Common qw(DELETE GET POST PUT);
use JSON qw(decode_json encode_json);
use LWP::UserAgent;
has base_url => ( is => 'ro', required => 1 );
has ua => (
self->req(POST $path, content => encode_json $params);
}
sub put {
my ($self, $path, $params) = @_;
return $self->req(PUT $path, content => encode_json $params);
}
sub delete {
my ($self
ATED in favor of'
. ' WebService::Client.';
$req->header(content_type => 'application/json');
$self->_log_request($req);
my $res = $self->ua->request($req);
Moo::Role->apply_ro
package WebService::Openaura;
use JSON::XS;
use Cache::LRU;
use Net::DNS::Lite;
use Furl;
use URI;
use URI::QueryParam;
use Carp;
use Moo;
use namespace::clean;
our $VERSION = "0.02";
$Net::DNS::Lit
sts(?:_all)*|) {
$content =~ s/^(\[.+\])$/{ "artists": $1 }/;
}
my $data = decode_json( $content );
if ( defined $data->{results}{error} ) {
my $type = $data->{results
cription provided in L<DR::Tarantool::Spaces>.
Supported data types are numbers, Unicode strings, JSON,
fixed-point decimals.
=head3 Insertion
$tnt->insert('users' => [ 123, 'vasya', 'admin' ]);
s above, but uses B<NUM64> as the underlying storage.
=item JSON
An arbitrary Perl object is automatically serialized to JSON with
L<JSON::XS> on insertion, and deserialized on selection.
=back
Th
necessary:
L<AnyEvent>, L<Coro>, L<Test::Pod>, L<Test::Spelling>,
L<Devel::GlobalDestruction>, L<JSON::XS>.
To run tests, do:
perl Makefile.PL
make
make test
The test suite attempts to
bService::Sift::VERSION);
$self->default_method('POST');
$self->content_type('application/json');
$self->base_url('https://api.siftscience.com/v203');
$self->auth_type('hash_key');
{
name => 'opts',
type => 'JSON',
}
],
indexes => {
0 =
INT & INT64
The same as B<NUM> and B<NUM64>, but contain signed values.
=item JSON
The field is encoded with L<JSON::XS> when putting
into a database, and decoded after is received back
from the
ple( $tuple );
}
package DR::Tarantool::Space;
use Carp;
$Carp::Internal{ (__PACKAGE__) }++;
use JSON::XS ();
use Digest::MD5 ();
=head1 SPACES methods
=head2 new
constructor
use DR::Taranto
Serializer::JSONPP;
use strict;
use warnings;
use 5.008_005;
our $VERSION = '0.02';
use Dancer::Config 'setting';
use Dancer::SharedData;
use base 'Dancer::Serializer::Abstract';
use JSON::PP;
sub
sub _build_jsonpp {
my $self = shift;
my $json = JSON::PP->new;
my $options = {};
my $config = setting('engines') || {};
$config = $config->{JSONPP} || $config->{JSON} || {};
# straight pass through of config options to JSON
map { $options->{$_} = $config->{$_} } keys %$config;
# pull in config from serializer init as well (and possibly override settings from t
package WebService::Decibel;
use JSON::XS;
use Cache::LRU;
use Net::DNS::Lite;
use Furl;
use URI;
use URI::QueryParam;
use Carp;
use Moo;
use namespace::clean;
our $VERSION = "0.03";
$Net::DNS::Lite
);
if ( $content !~ /^\{/) {
confess $content;
} else {
return decode_json( $content );
}
}
1;
__END__
=encoding utf-8
=head1 NAME
WebService::Decibel - A simple a
desirable.
This module is handy when programming a serialization strategy for
a Perl object into JSON where datatypes affect the output.
=head1 EXPORTED SUBROUTINES
All subroutines are exported by
return {
json => {
type => 'application/json',
exporter => [ 'JSON', pretty => 1 ],
docs => 'http://json.org/',
},
sgi> and query via unAPI:
curl 'localhost:5000'
curl 'localhost:5000?id=1204.0492&format=json'
=head1 CONFIGURATION
=over
=item query
Code reference with a query method to get an item (as
default only
JSON and YAML are configured as following:
json => {
type => 'application/json',
exporter => [ 'JSON', pretty => 1 ],
docs => 'http://json.org/'
}
use Mojo::JSON;
use DateTime;
sub new {
my $that = shift;
my $proto = ref($that) || $that;
my $self = $proto->SUPER::new(@_);
bless( $self, $proto );
$self->{json} = Mojo::JSON->new;
$data ) = @_;
my ( $package, $filename, $line ) = caller;
my $dt = DateTime->now;
$data->{package} = $package;
$self->info( $self->json->encode($data) );
}
sub json { (shift)->{json} }
1;
es) on each table. The structure is intended to be
passed to is_deeply for comparison.
=cut
use JSON; # Used to convert perl data to a string.
use Moose;
use MooseX::StrictConstructor;
=head1 FI
isa => 'Ref',
lazy_build => 1,
);
has _json_engine => (
is => 'ro',
isa => 'JSON',
default => sub { return JSON->new->pretty(1) }
);
=head1 LICENSE AND COPYRIGHT
package WJSON;
use Moose;
use JSON;
use Encode;
use Tie::IxHash;
no warnings 'uninitialized';
our $VERSION = '0.08';
has 'json' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {
alar(@{$self->json}) || 1;
if (scalar(@{$self->reference->{$tmp.'/'.$key}}) == 1) {
my $result = $self->reference->{$tmp.'/'.$key}[0];
if (ref($self->json->[$total - 1]
if ($type == 1) {
push(@{$self->json}, {$key => $result});
}elsif($type == 2) {
$self->json->[$total - 1]{$key} = [$result];
}e
OKKO';
}
$Finance::Bank::Paytrail::VERSION = '0.010';
use Moose;
use utf8;
use Data::Dumper;
use JSON::XS;
use Net::SSLeay qw/post_https make_headers/;
use Digest::MD5 qw/md5_hex/;
use MIME::Base64;
> '6pKF4jkv97zmqBJ3ZL8gUw5DfT2NMQ' );
=encoding utf-8
=cut
# ABSTRACT: Process payments through JSON API of Paytrail (Suomen Verkkomaksut) in Finland. Payments from all Finnish Banks online: Nordea,
ng through Collector and Klarna.
=head1 NAME
Finance::Bank::Paytrail - Process payments through JSON API of Paytrail (Suomen Verkkomaksut) in Finland. Payments from all Finnish Banks online: Nordea,
my $self = shift;
my $return_hash = {};
my $dbh = $self->dbh;
my $json = $self->_json_engine;
# TODO: Use "show create table $table" here instead
# as people
tore as a json string so that differences are easy to
# understand when they occur.
my @colums = ();
foreach my $name (@colum_names) {
push @colums, $json->encode(
age RDF::vCard::Entity;
use 5.008;
use strict;
use warnings;
no warnings qw(uninitialized);
use JSON qw[];
use RDF::TrineX::Functions
-shortcuts,
statement => { -as => 'rdf_statement' },
iri
return $self;
}
sub to_jcard
{
my ($self, $hashref) = @_;
return ($hashref ? $self->TO_JSON : JSON::to_json($self));
}
{
my @singular = qw(fn n bday tz geo sort-string uid class rev
anniversary
dday death gender kind prodid sex version);
my @typed = qw(email tel adr label impp);
sub TO_JSON
{
my ($self) = @_;
my $object = {};
foreach my $line (@{ $self->lines })
{
my $p =
^{)) { return ('string', $what) } # json string
if ($what =~ m{^\[}) { return ('string', $what) } # json string
if ($what =~ m{\n[\s\w]}) { return ('s
sed to L<File::Spec/catfile>
as portable file addressing).
First time I've used L<IO::Any> for L<JSON::Util> where for the functions
to encode and decode needs to read/write data.
=head1 METHODS
=h