nce;
eval {
require JSON::XS;
$instance = JSON::XS->new->utf8->allow_nonref;
1;
} or do {
require JSON;
$instance = JSON->new->utf8->allow_nonref;
}
-json=json2
--runtime=standard
--runtime=lite Same as --ajax=none --json=none
--runtime=jquery Same as --ajax=jquery --json=none
--runtime=yui Same as --ajax=yui --json=
ajax=gregory --json=json2
--json By itself, equivalent to --json=json2
--json=json2 Include http://www.json.org/json2.js for parsing/stringifying
--json=yui U
se YUI: YAHOO.lang.JSON (requires external YUI)
--json=none Doesn't provide any JSON functionality except a warning
--ajax By itself, equivalent to --ajax=xhr
--ajax=
DATE
our $VERSION = '0.08'; # VERSION
use 5.010;
use strict;
use warnings;
use HTTP::Tiny;
use JSON::MaybeXS;
sub check_latest_version {
my ($mod, $installed_version, $chkres) = @_;
my $r
$res->{reason}"] unless $res->{success};
eval { $res = JSON::MaybeXS::decode_json($res->{content}) };
return [500, "Can't decode JSON API response: $@"] if $@;
return [500, "Error from API
uest;
use JSON;
use List::Util qw/first/;
use LWP::UserAgent;
use Moo;
use Ouch;
use URI;
use Sys::SigAction qw( timeout_call );
# ABSTRACT: API client for Stripe
my $REST_FORMAT = 'json';
# https
my $req = HTTP::Request->new (GET => $dns_uri);
$req->content_type('application/json');
my $lwp = LWP::UserAgent->new;
$lwp->timeout($timeout);
$
s_uri->query_form( $params );
my $res = $self->rest_call($dns_uri);
my $response = from_json($res->content);
unless (ref($response) eq 'ARRAY') {
return { ok => 0, msg => $respo
Class => 'CPANPLUS', Style => 'gettext';
use CPANPLUS::Internals::Source::MetaCPAN::HTTP;
use JSON::PP ();
require Tie::Hash;
use vars qw[@ISA];
push @ISA, 'Tie::StdHash';
sub TIEHASH {
my $
urn unless $status eq '200';
return unless $str = $http->body;
eval { $href = JSON::PP::decode_json( $str ); };
return unless $href and keys %$href;
}
### expand author if n
return unless $str = $http->body;
my $dref;
eval { $dref = JSON::PP::decode_json( $str ); };
return unless $dref and keys %$dref;
( $href->{dist_file
=> 'frontend/Makefile.am',
'frontend/Manifest.json' => 'frontend/Manifest.json',
'frontend/config.json' => 'frontend/config.json',
'frontend/source/class/app/Application.js' =
se Moo;
use Types::Standard qw<Str ArrayRef InstanceOf>;
use namespace::autoclean;
use Carp;
use JSON::MaybeXS 1.001000;
use Try::Tiny;
use HTTP::Tiny 0.014;
with qw/
MetaCPAN::API::Author
M
AN::API::VERSION || 'xx';
return [ agent => "MetaCPAN::API/$version" ];
},
);
my $JSON = JSON::MaybeXS->new(canonical => 1, utf8 => 1);
sub _build_ua {
my $self = shift;
return H
my $query_json = $JSON->encode( $query );
my $result = $self->ua->request(
'POST',
"$base/$url",
{
headers => { 'Content-Type' => 'application/json' },
7-06-09.
=head1 SYNOPSIS
In your command-line script (e.g. named list-cpan-dists):
use JSON qw(decode_json);
use LWP::Simple;
use Perinci::CmdLine::Easy qw(run_cmdline_app);
run_cmdline_app(
status:latest&fields=name&size=5000"
or die "Can't query MetaCPAN";
$res = $json->decode($res);
die "MetaCPAN timed out\n" if $res->{timed_out};
my @dists;
r" perl scripts/log.pl
use strict;
use warnings;
use Curses::UI;
use Data::Dumper;
use JSON::Tiny qw(encode_json);
use Data::Faker;
use Log::Log4perl;
use Log::Log4perl::DataDumper;
use Log::Log4
thods)
{
$data{$_} = $faker->$_();
}
my $l = {};
$l->{'json'} = encode_json(\%data);
$l->{'dumper'} = Dumper(%data);
$l->{raw} = \%data;
$log->debug($l)
se warnings;
use Carp qw(croak);
use HTTP::Request::Common qw(GET POST);
use LWP::UserAgent;
use JSON::MaybeXS;
use URI;
use URI::Escape;
use URI::QueryParam;
use WebService::Google::Reader::Constan
y, %fields, output => 'json' });
my $req = HTTP::Request->new(GET => $uri);
my $res = $self->_request($req) or return;
my @ids = do {
my $ref = eval { JSON->new->decode($res->dec
oded_content) } or do {
$self->error("Failed to parse JSON response: $@");
return;
};
map { $_->{id} } @{$ref->{results}};
};
return unless @ids;
if
ur $VERSION = 1.7;
use strict;
use warnings;
use Moose;
use namespace::autoclean;
use JSON::Tiny qw(encode_json);
use Sys::Hostname;
use Data::UUID;
use POSIX qw(strftime);
use Log::Log4perl;
use
;
{ $self->short_message() } #fire off lazy message builder
return {%$self};
}
sub TO_JSON {
my $self = shift;
{ $self->short_message() } #fire off lazy message builder
retu
v::config;
use strict;
use warnings FATAL => 'all';
# Import Module :
use Data::Dumper;
use JSON;
use JSON::XS;
use UNIVERSAL::ref;
use Hash::MultiValue;
use Term::ReadKey;
use GnuPG qw( :algo );
use
my $data_cfg = decode_json($get_cfg);
$data = $data_cfg;
} else {
BlankOnDev::Utils::file->create($file_name, $dir_dev, encode_json($format_config));
e {
mkdir($dir_dev);
BlankOnDev::Utils::file->create($file_name, $dir_dev, encode_json($format_config));
$data = $format_config;
}
$gencfg = $data;
}
# Subroutine for
Or
prove -PTest::DB::Shared::mysqld=./testmysqld.json
The ./testmysqld.json file can contain the arguments to Test::DB::Shared::mysqld in a json format (see SYNOPSIS). They
will be used to build o
tate.
=head1 METHODS
=cut
use Moo;
use Carp qw/confess/;
use Log::Any qw/$log/;
use DBI;
use JSON;
use Test::mysqld;
use File::Slurp;
use File::Spec;
use File::Flock::Tiny;
use POSIX qw(SIGTERM
nfess("Cannot find config file $config_file");
}else{
$config = JSON::decode_json( scalar( File::Slurp::read_file( $config_file, { binmode => ':raw' } ) ) );
}
se JSON::PP ();
our $VERSION = '0.16';
sub opt_c { shift->_elem('opt_c', @_) }
sub live_cpan_url {
my $self = shift;
my $module = shift;
if ($self->opt_c) {
my $module_json =
ibution");
if (!$module_json) {
die "Unable to fetch changes for $module";
}
my $module_details = JSON::PP::decode_json($module_json);
my $dist = $module_de
e);
my $content = $self->fetch_url($url);
if ($self->opt_c) {
$content = JSON::PP::decode_json($content)->{content};
$content = "=pod\n\n$content";
}
return $content;
Interface to the Globus research data sharing service
use strict;
use warnings;
use Carp ;
use JSON ;
use Net::OpenSSH ;
=pod
=head1 NAME
Globus - Object-Oriented interface to Globus
=head1 DES
f->{username}, $self->{key_path} ) ;
return {} unless $result =~ m{\w} ;
my $obj = decode_json $result ;
return wantarray ? %$obj : $obj ;
}
sub acl_add {
my ( $self, $endpoint, $
= _globus_action( $command, $self->{username}, $self->{key_path} ) ;
my $slist = decode_json $result ;
my @list = grep { $_->{permissions} ne 'rw' } @$slist ;
return wantarray ? @lis
sInfo;
use strict;
use warnings;
use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
use JSON;
use Data::Munge qw/elem/;
use Scalar::Util qw/reftype looks_like_number/;
extends 'DBIx::Class::
ame");
sub decoded_value
{
my $self = shift;
return if not defined $self->value;
return JSON->new->allow_nonref->decode($self->value);
}
sub viable_type_conversions {
my $self = shift;
f->decoded_value;
if (ref $value) {
if (ref $value =~ /Bool/) {
# JSON::Boolean, JSON::PP::Boolean, etc
$self->data_type('bool')
}
elsif (reftype $
package BlankOnDev::config::save;
use strict;
use warnings FATAL => 'all';
# Import Module :
use JSON::XS;
use BlankOnDev::Utils::file;
# Version :
our $VERSION = '0.1005';
# Subroutine save key co
-
sub save_to_file {
my ($self, $filename, $dir_dev, $data) = @_;
my $data_file = encode_json($data);
my $create_file = BlankOnDev::Utils::file->create($filename, $dir_dev, $data_file);
i.
sudo cpan -i Crypt::Blowfish Digest::MD5
sudo cpan -i MIME::Base64 MIME::Base64::Perl JSON DateTime
sudo cpan -i GnuPG Hash::MultiValue Term::ReadKey LWP::UserAgent
sudo cpan -i Te
my %auth_params = (
Timestamp => sprintf("%s", DateTime->now()),
Format => 'JSON',
Version => $Version,
SignatureMethod => 'HMAC-SHA1',
SignatureVersio
\%auth_params );
$tx = $self->ua->start($tx);
return $tx->res->json if ($tx->res->headers->content_type || '') =~ /json/;
my $err = $tx->error;
croak "$err->{code} response: $err->{m
est::Mojo->new('<%= $p->{class} %>');
$t->post_ok('/jsonrpc','{"id":1,"service":"<%= $p->{name} %>","method":"ping","params":["hello"]}')
->json_is('',{id=>1,result=>'got hello'},'post request');