Geo::Coder::PlaceFinder;
our $VERSION = '0.1';
use strict;
use Carp qw(croak);
use Encode;
use JSON;
use LWP::UserAgent;
use Net::OAuth;
use URI;
$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOC
s_error ) {
die "PlaceFinder API returned error: " . $res->status_line;
};
my $data = decode_json( $res->content );
my $response = $data->{bossresponse}->{placefinder}->{results}->[0];
my $re
$Opsview::REST::APICaller::VERSION = '0.013';
}
use Moo::Role;
use Carp;
use Try::Tiny;
use JSON ();
use HTTP::Tiny 0.014;
has ua => (
is => 'ro',
default => sub { HTTP::Tiny->new(
'Accept' => 'application/json',
'Content-type' => 'application/json',
}; },
);
has json => (
is => 'ro',
default => sub { JSON->new },
);
sub get {
my $self
=> $self->headers,
});
croak $self->_errmsg($r) unless $r->{success};
return $self->json->decode($r->{content});
}
sub delete {
my $self = shift;
my $r = $self->ua->delete($self
ad1 VERSION
version 0.57
=head1 DESCRIPTION
This typemap is suitable for serialization using L<JSON>. It stringifies or
otherwise converts data structures into primitive representations.
=head1 AU
DESCRIPTION
The default typemap is actually defined per backend, in
L<KiokuDB::TypeMap::Default::JSON> and L<KiokuDB::TypeMap::Default::Storable>.
The list of classes handled by both is the same, but
ple
L<KiokuDB::Backend::Serialize::Storable> is binary safe, while
L<KiokuDB::Backend::Serialize::JSON> is not).
=head1 AUTHOR
Yuval Kogman <nothingmuch@woobling.org>
=head1 COPYRIGHT AND LICENSE
ojolicious::Plugin::DirectoryQueue;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON qw(decode_json encode_json);
use Directory::Queue;
use POSIX qw(chown);
our $VERSION = '0.01';
sub register
elper(
enqueue => sub {
my ($self, $args) = @_;
$dirq->add(encode_json($args));
},
);
$app->helper(
dequeue => sub {
for (my $name
my $data = $dirq->get($name);
$dirq->remove($name);
return decode_json($data) if $data;
}
return;
},
);
$app->helper(
s
ry data to JSPON compliant structures
use KiokuDB::Entry;
use KiokuDB::Reference;
use JSON::XS 2.231 ();
use JSON 2.12;
use namespace::clean -except => 'meta';
with qw(KiokuDB::Backend::Serialize::
( $data->root ? ( $self->root_field => JSON::true() ) : () ),
( $data->deleted ? ( $self->deleted_field => JSON::true() ) : () ),
( $data->has_tied ? (
the entry recursively, returning a JSPON compliant data structure
suitable for serialization as a JSON string.
=back
=head1 AUTHOR
Yuval Kogman <nothingmuch@woobling.org>
=head1 COPYRIGHT AND LICE
apser;
use namespace::clean -except => 'meta';
with qw(
KiokuDB::Backend::TypeMap::Default::JSON
KiokuDB::Backend::Serialize::JSPON::Converter
);
has expander => (
isa => "KiokuDB::Back
<KiokuDB::Entry> and
L<KiokuDB::Reference> objects.
For serialization to JSON strings see L<KiokuDB::Backend::Serialize::JSON>.
=head1 METHODS
=over 4
=item expand_jspon
See L<KiokuDB::Backend::S
TP::Request::Common qw(GET POST);
use URI;
use URI::QueryParam;
use LWP::UserAgent;
use JSON qw(to_json from_json);
use Carp qw(croak);
use Log::Any qw($log);
use Try::Tiny;
has scheme => (is => 'ro
(
q => $query,
format => 'json',
env => 'store://datatables.org/alltableswithkeys',
jsonCompat => 'new',
);
my $uri = URI->new($self->u
$res = $self->ua->request($req);
}
return from_json $res->content
if $res->code =~ /^4/x;
return $res->content ? from_json($res->content)->{query}{results} : 1;
}
sub _log_conte
b _build_solr {
WebService::Solr->new($_[0]->url, {autocommit => 0, default_params => {wt => 'json'}});
}
=head1 SUPPORT
Solr schemas need to support '_id' and '_bag' record fields to be able to
use Form::Toolkit::Clerk::Hash;
use Form::Toolkit::Field;
use Form::Toolkit::Field::String;
use JSON;
use MIME::Base64;
use Scalar::Util;
with qw(MooseX::Clone);
=head1 NAME
Form::Toolkit::Form
for Form implementation
=cut
__PACKAGE__->meta->id_prefix('form_');
has 'jsoner' => ( isa => 'JSON' , is => 'ro', required => 1, lazy_build => 1);
has 'fields' => ( isa => 'ArrayRef[Form::Toolkit
lds
=cut
sub BUILD{
my ($self) = @_;
$self->build_fields();
}
sub _build_jsoner{
my ($self) = @_;
return JSON->new->ascii(1)->pretty(0);
}
=head2 fast_clone
Returns fast clone of this fo
possible with JSON atm", 1 if (
( $self->directory->backend->can("serializer")
and $self->directory->backend->serializer->isa('KiokuDB::Serializer::JSON') )
or $self->directory->backend->does("KiokuDB::Backend::Serialize::JSON")
or $self->directory->backend->does("KiokuDB::Backend::Serialize::JSPON")
);
isa_o
package Plack::Middleware::JSONParser;
use strict;
use warnings;
use JSON;
use Hash::MultiValue;
use Plack::Request;
our $VERSION = "0.02";
use parent 'Plack::Middleware';
sub call {
my ($self,
m{\Aapplication/json}o) {
my $req = Plack::Request->new( $env );
my $raw_body = $req->raw_body();
return $self->app->($env) unless ($raw_body);
my $json;
{
local $@;
$json = eval { decode_json($raw_body) };
if ($@) {
die $@ if $self->{die_when_failed};
$env->{'plack.middleware.jsonparser.error'} = $@;
et_json = scan_result('json');
Get all the detected matches on files within the project directory. Parameter $format can be one of
the I<txt> - plain text, I<html> - formatted HTML tables or I<json>
nning.
=head2 C<exclude_extension>
exclude_extension: png jpg gif pdf doc docx html htm xml json xls
This is a global setting, so should be defined under the section C<GLOBAL> or in the very be
ckend is
L<KiokuDB::Serializer::JSON>, we examine the data.
=end original
DBIバックエンドのデフォルトのシリアライザーはL<KiokuDB::Serializer::JSON>ですので、
データを
ll notice the C<spouse> field has a JSON object with a C<$ref> field inside
it holding the UUID of the target object.
=end original
C<spouse>フィールドがJSONオブジェクトということ
otion;
use 5.008005;
use strict;
use warnings;
use AnyEvent::Handle;
use AnyEvent::Socket ();
use JSON ();
use Protocol::WebSocket;
use Protocol::WebSocket::Frame;
use Protocol::WebSocket::Handshake::
if (my $message = $self->{frame}->next_bytes) {
my $data = JSON::decode_json($message);
if (exists $data->{id} && exists $data->{timestamp}) {
});
});
};
}
sub send {
my ($self, $data) = @_;
my $message = JSON::encode_json($data);
my $frame = Protocol::WebSocket::Frame->new($message);
$self->{handle}->pu
l or as URL
'-dataformat' => 'nexus',
'-treeformat' => 'newick',
'-metaformat' => 'json',
'-charsetformat' => 'nexus',
);
my $merger = Bio::BioVeL::Service::NeXMLMerger->new;
my $
my $changes = CPAN::Changes->load('Changes');
my $meta = CPAN::Meta->load_file('META.json');
my $doap = RDF::DOAP::Lite->new(meta => $meta, changes => $changes);
$doap->doap_
ngs;
our $VERSION = "0.06";
use AnyEvent::APNS;
use Cache::LRU;
use Encode qw/decode_utf8/;
use JSON::XS;
use Log::Minimal;
use Plack::Request;
use Router::Boom::Method;
use Class::Accessor::Lite::
if (my $payload_json = $req->param('payload') ) {
state $json_driver = JSON::XS->new->utf8;
local $@;
$payload = eval { $json_driver->decode($payload_json) };
return
scalar( @{ $self->_queue } ),
};
my $body = encode_json($result);
return [200, [
'Content-Type' => 'application/json; charset=utf-8',
'Content-Length' => length($body),
($self->url => json => $self->_json_content($ex, $app, $c), $call_back );
}
sub _json_content {
my $self = shift;
my $ex = shift;
my $app = shift;
my $c = shift;
my $json = {
notifi
$VERSION,
url => 'https://github.com/jontaylor/Mojolicious-Plugin-Airbrake'
}
};
$json->{errors} = [{
type => ref $ex,
message => $ex->message,
backtrace => [],
}];
fo
line, $subroutine) = @$frame;
push @{$json->{errors}->[0]->{backtrace}}, {
file => $file, line => $line, function => $subroutine
};
}
$json->{context} = {
environment => $app->m