~ /(?:<|!=|==)/}sub encode_json {my($self,$data)=@_;require JSON::PP;my$json=JSON::PP::encode_json($data);$json =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;$json}sub version_to_query {my($
atch->{hits}{hits}};$hits[0]->{fields}}sub search_metacpan {my($self,$module,$version)=@_;require JSON::PP;$self->chat("Searching $module ($version) on metacpan ...\n");my$metacpan_uri='http://api.met
ified",query=>{constant_score=>{filter=>{and=>[{term=>{'module.authorized'=>JSON::PP::true()}},{term=>{'module.indexed'=>JSON::PP::true()}},{term=>{'module.name'=>$module }},$self->version_to_query($m
#ifndef SRL_COMMON_H_
#define SRL_COMMON_H_
#include "srl_inline.h"
/* inspired by JSON::XS code */
#if __GNUC__ >= 3
# define expect(expr,value) __builtin_expect((expr), (value))
#else
# define exp
installation
$Installer::Software::VERSION = '0.904';
use Moo;
use IO::All;
use IO::All::LWP;
use JSON_File;
use Path::Class;
use File::chdir;
use Archive::Extract;
use namespace::clean;
has target =
y => 1,
default => sub {
my ( $self ) = @_;
tie(my %meta,'JSON_File',file($self->target->installer_dir,$_[0]->alias.'.json')->stringify,, pretty => 1 );
return \%meta;
},
);
has testa
ions
=head1 VERSION
version 0.104
=head1 SYNOPSIS
package MyApp::Web;
use Yeb qw( Session JSON );
r "/" => sub {
session test => pa('test');
text "root";
};
r "/blub" => sub {
n '+SomeOther::YebApp';
};
1;
package MyApp::Web::Test;
use MyApp::Web;
r "/json" => sub {
json {
test => session('test'),
stash_var => st('stash_var'),
}
};
r "/
ds L<plackup>
Bigger L<Text::Xslate> example:
package MyApp::WebXslate;
use Yeb Session => JSON => 'Xslate';
# because of the root() usage we need to use plugin function call
plugin Static
plugins(
['Git::GatherDir', { exclude_filename => [
'META.json',
'LICENSE',
'README.md',
},
],
['CopyFilesFromBuild', { copy => [
'META.json',
'LICENSE',
$self->build_f
'dist.ini',
'Changes',
'META.json',
'README.md',
'README',
pt';
use Zonemaster;
use Zonemaster::Util ();
use Zonemaster::Logger::Entry;
use Net::LDNS;
use JSON::XS;
my $can_use_threads = eval 'use threads; use Thread::Queue; 1';
=encoding utf8
=head1 NAM
RR 'start thread';
threads->create(
sub {
my $json = JSON::XS->new->allow_blessed->convert_blessed->canonical;
$self->debug and sa
$self->debug and say STDERR 'dequeued in';
$self->process( $json->decode( $in ), $out_q );
}
}
);
}
xt::Xslate>
=head3 L<Yeb::Plugin::JSON> 0.101
JSON responses using L<JSON::MaybeXS>
=head3 L<Yeb::Plugin::GeoJSON> 0.003
Generating GeoJSON output via L<Geo::JSON::Simple> functions
=head1 AUTHOR
ta::UUID ();
use MIME::Base64 ();
use AnyEvent ();
use AnyEvent::Handle ();
use JSON::XS ();
use HTTP::Status ();
use URI::Escape::XS qw(uri_escape);
use AnyEvent::Util (
less ( ref( $args{on_eof} ) eq 'CODE' ) {
confess 'on_eof is not CODE';
}
my $json = JSON::XS->new->utf8;
my ( $read, $write ) = AnyEvent::Util::portable_pipe;
my $hdl = AnyEv
return;
}
my @entries;
eval {
@entries = $json->incr_parse( @_ );
foreach ( @entries ) {
unless ( ref( $_ )
ば、enqueueする引数の情報をJSONでシリアライズしたい場合は
my $client = Qudo->new(... , default_hooks => ["Qudo::Hook::Serialize::JSON"]);
$client->enqueue('Test::Worker
のようにHookモジュールをnewの引数に渡す事で設定でき、
設定した引数がJSONでシリアライズされて保存されます。
Hookは利用者が好きに書く事がで
nyEvent::CouchDB ();
use Lim::Plugin::Zonalizer qw(:err);
use URI::Escape::XS qw(uri_escape);
use JSON ();
use Clone qw(clone);
use base qw(Lim::Plugin::Zonalizer::DB);
our %VALID_ORDER_FIELD = ( an
urn;
}
foreach ( @$rows ) {
$_->{_deleted} = JSON::true;
}
# uncoverable branch false
Lim::DEBUG a
$args{cb}->();
return;
}
$rows->[0]->{_deleted} = JSON::true;
# uncoverable branch false
Lim::DEBUG and $self->{logger}->debug(
package Web::ChromeLogger;
use 5.008005;
use strict;
use warnings;
our $VERSION = "0.06";
use JSON::XS qw//;
use MIME::Base64 qw//;
sub new {
my $class = shift;
my %args = @_==1 ? %{$_[0]}
represent in JSON.
$self->{'json_encoder'} ||= JSON::XS->new()->ascii(1)->convert_blessed->allow_unknown;
$self->{'logs'} = [];
return $self;
}
sub json_encoder { $_[0]->{json_encoder} }
b to_json {
my ($self, $stuff) = @_;
"$stuff"
}
sub encode {
my ($self, $rows) = @_;
no warnings 'once';
local *UNIVERSAL::TO_JSON = sub { $self->to_json(@_) };
my $json_data
;
use warnings;
$WebService::Walmart::VERSION = "0.01";
use Moose;
use Try::Tiny;
use JSON::MaybeXS qw/ decode_json /;
use Data::Dumper;
use WebService::Walmart::Store;
use WebService::Walmart::Item;
y $content = $response->{content};
my $status = $response->{status};
my $h = decode_json($content);
#return $h;
my $item = WebService::Walmart::Item->new($h);
return $item;
}
my $h = decode_json($content);
my $r = $h->{reviews};
my @reviews;
foreach my $store_json (@$r) {
my $store = WebService::Walmart::Review->new($store_json);
push @
Time::Progress::Stored::Storage::Redis - Store the reports in Redis
=cut
use JSON::Tiny qw/ encode_json decode_json /;
=head1 PROPERTIES
=cut
has redis => (
is => "ro",
isa
ub store {
my $self = shift;
my ($id, $content) = @_;
$self->redis->set( $id , encode_json($content) );
}
=head2 retrieve($id) : $content | undef
Retrieve the current report $content und
key, or undef if
none was found.
=cut
sub retrieve {
my $self = shift;
my ($id) = @_;
my $report_json = $self->redis->get($id) // return undef;
return decode_json( $report_json );
}
::PerlGuardServer;
use Moo;
extends 'PerlGuard::Agent::Output';
use HTTP::Async;
use Encode;
use JSON;
use HTTP::Request;
use HTTP::Headers;
use Time::HiRes;
has api_key => ( is => 'rw', lazy => 1,
=> shift->api_key,
'content-type' => 'application/json'
)
});
has json_encoder => ( is => 'rw', lazy => 1, default => sub { JSON->new->utf8->convert_blessed->allow_blessed });
sub DEFAU
sum_of_web_transactions" => $profile->webservice_transaction_count,
};
$content = $self->json_encoder->encode($content);
};
#warn $content;
$self->check_responses();
unless($s
umn names as an array reference.
=head2 expand
$results = $results->expand;
Decode C<json> and C<jsonb> fields automatically for all rows.
=head2 hash
my $row = $results->hash;
Return ne
ttern] : [];
my $s_key;
if ( $or_self->{cache} ) {
require JSON::XS;
$s_key = JSON::XS::encode_json($ar_pattern);
if ( my $ar_search_data = $or_self->{cache}->get("lis
# cache?
my $s_key;
if ( $or_self->{cache} ) {
require JSON::XS;
$s_key = JSON::XS::encode_json({bench_value_id => $i_bench_value_id});
if ( my $hr_search_data = $
arch ) = @_;
my $s_key;
if ( $or_self->{cache} ) {
require JSON::XS;
$s_key = JSON::XS::encode_json($hr_search);
if ( my $ar_search_data = $or_self->{cache}->get("sear
chmatics;
$WebService::Speechmatics::VERSION = '0.02';
use 5.010;
use Moo 1.006;
use JSON qw/ decode_json /;
use Carp qw/ croak /;
use File::Basename qw/ basename /;
use S
$self = shift;
my $response = $self->$get('/user/'.$self->user_id);
my $userdata = decode_json($response->content);
return WebService::Speechmatics::User->new($userdata->{user});
}
sub b
shift;
my $response = $self->$get('/user/'.$self->user_id.'/jobs');
my $jobsdata = decode_json($response->content);
return map { WebService::Speechmatics::Job->new($_) }
@{
:Database::Manager;
use v5.20;
use strict;
use warnings;
our $VERSION = '0.03';
use JSON::RPC2::Client;
use JSON::XS;
use LWP::UserAgent;
use HTTP::Request;
use failures qw/odoo::rpc::http odoo::r
d_ua');
has json_rpc_client => (is => 'ro', lazy => 1, builder => 'build_json_rpc_client');
sub build_ua {
return LWP::UserAgent->new();
}
sub build_json_rpc_client {
return JSON::RPC2::Clie
ate_admin_pwd => $admin_password,
create_confirm_pwd => $admin_password,
)]);
# {"jsonrpc":"2.0","method":"call","params":{"fields":[{"name":"super_admin_pwd","value":"admin"},{"name":
C<belongs_to()> and maybe C<has_one()>.
=cut
use Mojo::Base -base;
use Mojo::IOLoop;
use Mojo::JSON ();
use Mojo::Loader 'load_class';
use Scalar::Util 'weaken';
use constant DEBUG => $ENV{MAD_DEBU
($self, $cb) = @_;
my @sql = $self->_delete_sql;
warn "[Mad::Mapper::delete] ", Mojo::JSON::encode_json(\@sql), "\n" if DEBUG;
if ($cb) {
weaken $self;
$self->db->query(
@sql,
per::has_many::$method] %s\n",
(!$fresh and $self->{cache}{$ck}) ? 'CACHED' : Mojo::JSON::encode_json(\@sql)
if DEBUG;
if ($cb) {
if ($fresh or !$self->{cache}{$ck}) {
package Net::Vimeo;
use Carp;
use Clone qw( clone );
use HTTP::Request;
use JSON qw( decode_json );
use Moose;
use Net::OAuth;
use namespace::autoclean;
with 'Net::Vimeo::OAuth';
our $VERSION = '0
q ) = @_;
croak "No request for content retrieving"
unless $req;
return decode_json( $req->content );
}
__PACKAGE__->meta->make_immutable;
1;
=head1 NAME
Net::Vimeo - Make reque
=> 'someuserid',
page => 1,
per_page => 10,
format => 'json',
};
my $result = $vimeo->make_api_request( 'GET', $request_params);
The canonical docu