vent;
use strict;
use warnings;
use base 'Armadito::Agent::HTTP::Client::ArmaditoAV::Event';
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
return $sel
>{jobj}->{task}->{obj} = $obj;
my $json_text = to_json( $self->{taskobj}->{jobj} );
print "JSON formatted str : \n" . $json_text . "\n";
$self->_sendToGLPI($json_text);
$self->{end_polling} = 1;
ION
C<PONAPI::Document::Builder::Resource> is used internally by
C<PONAPI::Document> to build C<{json:api}> documents. Generally,
these will be created by C<< PONAPI::Document->add_resources >>, whi
warnings;
use base 'Armadito::Agent::Task';
use Armadito::Agent::Storage;
use Data::Dumper;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
= @_;
$self->{logger}->info( "Successful Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
if ( defined( $obj->{jobs} ) && ref( $obj->{jobs} ) eq
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
w;
my @posts;
my $json = $ua->get('https://www.reddit.com/r/todayilearned.json')->res->json;
# Children are posts in reddit world.
foreach my $post (@{$json->{data}{children}}) {
Locale::Wolowitz;
# ABSTRACT: Dead simple localization with JSON.
use warnings;
use strict;
use utf8;
use Carp;
use JSON::MaybeXS qw/JSON/;
our $VERSION = "1.004001";
$VERSION = eval $VERSION;
=e
ing utf-8
=head1 NAME
Locale::Wolowitz - Dead simple localization with JSON.
=head1 SYNOPSIS
# in ./i18n/locales.coll.json
{
"Welcome!": {
"he": "ברוכים הבאים!",
"es": "Bienve
select the interface's language. Also, I grew to hate the standard .po
files, and thought using a JSON format might be more comfortable.
Locale::Wolowitz allows you to provide different languages to
:Reddit::Response;
$WebService::Reddit::Response::VERSION = '0.000003';
use Moo;
use JSON::MaybeXS qw( decode_json );
use Types::Standard qw( Bool InstanceOf Maybe HashRef );
has content => (
is
my $self = shift;
my $content = $self->raw->decoded_content;
return $content ? decode_json($content) : undef;
}
sub _build_success {
my $self = shift;
return $self->raw->is_succes
item raw
An L<HTTP::Response> object.
=back
=head1 METHODS
=head2 content
This is the parsed JSON body of the response. Generally this will be a C<HashRef>.
=head2 raw
Returns the raw L<HTTP::
package WWW::Shorten::Naver;
use strict;
use warnings;
use Carp ();
use JSON::MaybeXS;
use URI ();
use Scalar::Util qw(blessed);
use parent qw( WWW::Shorten::generic Exporter );
our @EXPORT = qw(new V
ation/json}) {
Carp::croak("Unexpected response: $content");
}
my $json = decode_json($content);
Carp::croak("Invalid data returned: $content") unless $json;
return $json->{res
package Swagger2::POD;
use Mojo::Base -base;
use Mojo::JSON 'encode_json';
use Mojo::Message::Response;
use Scalar::Util 'blessed';
use constant NO_DESCRIPTION => 'No description.';
require Swagger2;
obj->{$k} and $obj->{$k} eq Mojo::JSON->true;
return "$k=false" if blessed $obj->{$k} and $obj->{$k} eq Mojo::JSON->false;
return sprintf '%s=%s', $k, encode_json $obj->{$k} if ref $obj->{$k};
r
;
use JSON qw();
sub boolean_to_scalar_ref {
return unless JSON::is_bool($_[0]);
$_[0] = $_[0]
? \(my $t = 1)
: \(my $f = 0);
}
sub boolean_to_int {
return unless JSON::is_b
ool($_[0]);
$_[0] = int(!!$_[0]);
}
sub boolean_to_str {
return unless JSON::is_bool($_[0]);
$_[0] = $_[0]
? 'true'
: 'false';
}
sub _decode_uri ($) {
local $_ = shift //
package Bencher::ScenarioR::JSONDecodeRegexp::Startup;
our $VERSION = 0.003; # VERSION
our $results = [
[
200,
"OK",
[
{
errors => 5.5e-05,
mod_overhead_time => 2
ors => 1.9e-05,
mod_overhead_time => 3.4,
modver => 0.09,
participant => "JSON::Decode::Regexp",
proc_private_dirty_size => 3.7,
proc_rss_size => 7.3,
p
ors => 2.6e-05,
mod_overhead_time => 3.3,
modver => 0.07,
participant => "JSON::Decode::Regexp",
proc_private_dirty_size => 3.7,
proc_rss_size => 7.4,
p
s;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
use utf8;
use Data::Dumper;
use JSON qw();
our $VERSION = '0.20';
sub MAX_RECURSION () {300}
{
my $inc = caller() ? $INC{ __PAC
read_next_json_file () {
local $/;
local $SIG{__WARN__} = \&warn_without_line;
while (<>) {
utf8::encode($_) if utf8::is_utf8($_);
$_ = eval { JSON::decode_json($_) };
hift;
state $supported = {
'ddp' => 'App::yajg::Output::DDP',
'json' => 'App::yajg::Output::Json',
'perl' => 'App::yajg::Output::Perl',
'yaml' => 'App::yajg::Outpu
package WWW::MelbourneBikeShare;
use strict;
use warnings;
use LWP;
use JSON;
use WWW::MelbourneBikeShare::Terminal;
our $VERSION = 0.01;
sub new {
my ( $class, %args ) = @_;
my $self = bless {
LWP::UserAgent->new();
$self->{ __uri } = 'https://data.melbourne.vic.gov.au/resource/qnjw-wgaj.json';
$self->{ __cache }->{ timeout } = $args{ cache } ||= 900;
$self->{ __cache }->{ present } = 0
if ( $r->is_success ) {
$self->{ error } = '';
return from_json( $r->content );
}
else {
$self->{ error } = "Unable to retrieve $
$base_url = $args[$i + 1] if $_ eq '-b';
$args = Mojo::JSON::decode_json($args[0]) if /^\{/;
$args->{$1} = $2 if /^(\w+)=(.*)/;
f $base_url;
eval {
my $res = $client->$method($args);
print $OUT $res->json ? Mojo::Util::dumper($res->json) : $res->body;
1;
} or do {
my $e = $@;
$e =~ s! at .* line.*!!s;
pec.json" if $_[0] eq 'perldoc';
return "Usage: mojo swagger2 pod path/to/spec.json" if $_[0] eq 'pod';
return "Usage: mojo swagger2 validate path/to/spec.json"
*CreateGeometryFromGML = *Geo::OGRc::CreateGeometryFromGML;
*CreateGeometryFromJson = *Geo::OGRc::CreateGeometryFromJson;
*BuildPolygonFromEdges = *Geo::OGRc::BuildPolygonFromEdges;
*ApproximateArcAn
}
}
my $gml = $param{GML} // $param{gml};
my $json = $param{GeoJSON} // $param{geojson} // $param{JSON} // $param{json};
my $points = $param{Points} // $param{points};
my $ar
self = Geo::OGRc::CreateGeometryFromGML($gml);
} elsif (defined $json) {
$self = Geo::OGRc::CreateGeometryFromJson($json);
} elsif (defined $type) {
$type = Geo::GDAL::string2i
Moves;
use File::ShareDir qw(dist_file);
use File::Slurper qw(read_text);
use Cpanel::JSON::XS qw(decode_json);
require Exporter;
my ( $hECO, $hNIC, $hOpening );
my %hash = (
ECO =>
_GetPaths('Chess-PGN-EPD');
$hECO = decode_json read_text($ECO_path);
$hNIC = decode_json read_text($NIC_path);
$hOpening = decode_json read_text($Opening_path);
sub _GetPaths {
on three database files installed along with
the module. On demand other formats (the current is JSON) may be implemented. The 'ToDo' list
also mentions the possibility of extending the databases, a
Net::Amazon::DirectConnect;
use 5.10.0;
use strict;
use warnings FATAL => 'all';
use Carp;
use JSON;
use YAML::Tiny;
use HTTP::Request;
use LWP::UserAgent;
use Net::Amazon::Signature::V4;
my $yaml
%args);
my $response = $self->_request($method,
content => encode_json \%args
);
return decode_json $response->content if $response->is_success;
}
=head2 ua
Get or set UserAgen
Date => POSIX::strftime( '%Y%m%dT%H%M%SZ', gmtime ),
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => $self->spec->{target_prefix} . $operation,
exists $args{h
me =~ y/A-Z0-9//cd;
push @EXPORT_OK, $name;
constant->import($name, $_)
}
}
use JSON::MaybeXS qw/decode_json/;
use HTTP::Tiny;
use PerlX::Maybe;
use WWW::BackpackTF::Currency;
use WWW::BackpackT
die $htr->{reason} unless $htr->{success}; ## no critic (RequireCarping)
my $response = decode_json($htr->{content})->{response};
die $response->{message} unless $response->{success}; ## no critic
use warnings;
our $VERSION = '0.003';
use parent qw( SMS::Send::Driver );
use HTTP::Tiny;
use JSON;
our $URL = "http://api.apistore.co.kr/ppurio/1";
our $AGENT = 'SMS-Send-KR-APIStore/' . $
id response for POST request';
if ( $res && $res->{success} ) {
$ret{detail} = decode_json( $res->{content} );
$ret{success} = 1 if $ret{detail}{result_code} eq '200';
$re
valid response for GET request';
if ( $res && $res->{success} ) {
my $detail = decode_json( $res->{content} );
$ret{success} = 1 if $detail->{call_status} =~ m/^(4100|6600)$/;
tion/font-woff' => 'woff',
'application/javascript' => 'js',
'application/json' => 'json',
'application/pdf' => 'pdf',
'application/rss+xml' => 'rss',
my $uri = shift->url;
if ($uri =~ qr{\.(css|png|gif|jpeg|jpg|pdf|js|json)$}i) {
return 1;
}
if ($uri->host eq 'assets
agger2;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON;
use Mojo::Loader;
use Mojo::Util qw(decamelize deprecated);
use Swagger2;
use JSON::Validator::OpenAPI::Mojolicious;
use constant DEBUG
PACKAGE__, 'layouts/mojolicious_plugin_swagger.html.ep');
has url => '';
has _validator => sub { JSON::Validator::OpenAPI::Mojolicious->new; };
sub dispatch_to_swagger {
return undef unless $_[1]-
($c, $data) = @_;
my $self = $c->stash('swagger.plugin');
my $reply
= sub { $_[0]->send({json => {code => $_[2] || 200, id => $data->{id}, body => $_[1]}}) };
my $defaults = $self->{route_d