$self->installer);
}
my @dirty_files = ('dist.ini', 'Changes', 'META.json', 'README.md', $self->build_file);
my @exclude_release = ('README.md');
$self->add_plugi
git repo installable
[ 'Git::GatherDir', { exclude_filename => [ $self->build_file, 'META.json', 'LICENSE', @exclude_release ] } ],
[ 'CopyFilesFromBuild', { copy => [ 'LICENSE' ] } ],
re eg examples ) ] } ],
[ $self->prereqs ],
[ $self->installer ],
[ 'MetaJSON' ],
# standard stuff
[ 'PodSyntaxTests' ],
[ 'MetaYAML' ],
[ 'Li
package Log::QnD;
use strict;
use Carp 'croak';
use String::Util ':all';
use JSON qw{to_json -convert_blessed_universally};
# debugging
# use Debug::ShowStuff ':all';
# use Debug::ShowStuff::ShowVar;
in arrays and hashrefs. When the object goes out of scope its contents
are saved to the log as a JSON string.
PLEASE NOTE: Until this module reaches version 1.0, I might make some
non-backwards-comp
stage'} = 1;
$qnd->{'tracks'} = [qw{1 4}];
$qnd->{'coord'} = {x=>1, z=>42};
which results in a JSON string like this:
{"stage":1,"tracks":["1","4"],"time":"Tue May 20 17:13:22 2014","coord":{"x":
package HTCondor::Queue::Parser;
use strict;
use warnings;
use XML::Simple;
use JSON::XS;
# ABSTRACT: parses multible schedds condor_q output, so you don't have to. Serves output in many formats.
XMLin($xml);
$schedds_map{$schedd}{'href'} = $job_data;
}
return %schedds_map;
}
sub schedd_json {
my $self = shift;
my $schedds_map_href = shift;
my $schedd = shift;
my %schedds_map = %{$sc
chedds_map{$schedd}{'href'};
my $coder = JSON::XS->new->ascii->pretty->allow_nonref;
my $json = $coder->encode($schedds_map{$schedd}{'href'});
return $json;
}
1;
__END__
=pod
=head1 NAME
HTC
;
use Carp;
use Data::Dump qw( dump );
use JSON;
use Sort::SQL;
use Search::QueryParser::SQL;
our $VERSION = '0.006';
sub json_mime_type {'application/json'}
sub params_to_sql {
my $req = shift
olor )]
);
=head1 DESCRIPTION
Dezi::Admin utility functions.
=head1 FUNCTIONS
=head2 json_mime_type
Returns appropriate MIME type string.
=head2 params_to_sql( I<plack_request>, I<table
SION} );
use Carp;
use Data::Dump qw( dump );
use Parallel::Iterator qw( iterate_as_array );
use JSON;
use LWP::UserAgent;
use Scalar::Util qw( blessed );
use Search::Tools::XML;
use Data::Transforme
my $highest_score = 0;
if ( $resp->content_type eq 'application/json' ) {
my $r = decode_json( $resp->content );
if ( $r->{results} ) {
@resp_re
p qw( dump );
use Plack::Util::Accessor qw(
debug
conn
table_name
searcher
);
use JSON;
use Plack::Middleware::REST::Util;
use Dezi::Admin::Utils;
use Dezi::Admin::API::Response;
use T
undef;
if ( !$method ) {
$resp->status(404);
$resp->body(
encode_json(
{ code => 404,
success => 0,
error
;
}
$resp->status(200) unless $resp->status;
$resp->content_type(Dezi::Admin::Utils::json_mime_type)
unless $resp->content_type;
return $resp->finalize;
}
1;
__END__
=head
dmin::API;
use strict;
use warnings;
use Carp;
use Plack::Builder;
use Data::Dump qw( dump );
use JSON;
use Dezi::Admin::API::Indexes;
our $VERSION = '0.006';
=head1 NAME
Dezi::Admin::API - Dezi ad
};
$resp->body( to_json($about) );
$resp->status(200);
$resp->content_type('application/json');
return $resp->finalize();
W::Google::AutoSuggest;
use WWW::Google::AutoSuggest::Obj -base;
use LWP::UserAgent;
use URI;
use JSON;
use Encode;
our $VERSION = '0.04';
=encoding utf-8
=head1 NAME
WWW::Google::AutoSuggest - Qu
ogle::AutoSuggest->new(domain=> "it" ,json=>1); #uses www.google.it instead of .com
my $result = $AutoSuggest->search("perl");
# $result now is a decoded JSON arrayref
###### or with the html ta
returning it as decoded JSON for further inspection
=head1 ARGUMENTS
=over 4
=item json
my $AutoSuggest=WWW::Google::AutoSuggest->new(json=>1);
or
$AutoSuggest->json(1);
Explicitally enabl
eter;
use JSON;
sub new {
my ($class, $machine_type) = @_;
my $self = {};
bless $self, $class;
$self->{INTERPRETER} = Gcode::Interpreter->new($machine_type);
$self->{JSON} = JSON->new();
#$self->{JSON}->pretty(1);
$self->{WAYPOINT_LINES} = 0;
$self->{META_FILE} = undef;
return $self;
}
sub set_meta_file {
my ($self, $file) = @_;
$self->{META_FILE} = $file;
return 1;
}
open meta file $tmp_meta to write to it: $!\n";
return 0;
}
my $json = $self->{JSON}->encode($data);
print META $json;
foreach my $key (sort keys %$data) {
print "$key: " . $data->{$k
Component );
use Data::Dump qw( dump );
use Plack::Util::Accessor qw(
debug
engine
);
use JSON;
use Plack::Middleware::REST::Util;
use Dezi::Admin::Utils;
use Dezi::Admin::API::Response;
our
esponse;
$resp->status(200) unless $resp->status;
$resp->content_type(Dezi::Admin::Utils::json_mime_type)
unless $resp->content_type;
$resp->body($idx);
return $resp->finalize;
esponse;
$resp->status(200) unless $resp->status;
$resp->content_type(Dezi::Admin::Utils::json_mime_type)
unless $resp->content_type;
$resp->body("$list");
return $resp->finali
stash_key => 'message',
default => 'application/json',
map => {
'application/json' => 'JSON',
'text/x-json' => 'JSON',
},
);
around create_action => sub {
my
stash_key => 'message',
default => 'application/json',
map => {
'application/json' => 'JSON',
'text/x-json' => 'JSON',
},
);
See L<Catalyst::Action::Deserialize>
erload
'""' => sub { $_[0]->stringify; },
'bool' => sub {1},
fallback => 1;
use JSON;
use Plack::Util::Accessor qw(
total
success
results
metaData
);
sub new {
m
s,
};
return bless $self, $class;
}
sub stringify {
my $self = shift;
return to_json( {%$self} );
}
1;
__END__
=head1 NAME
Dezi::Admin::API::Response - Dezi administration API re
total,
results => $list,
);
print $resp; # renders as JSON
=head1 DESCRIPTION
Dezi::Admin::API::Response represents a JSON response to an API call.
=head1 METHODS
=head2 new( I<args
=> 1, # include results
t => 'XML', # or JSON
u => 'http://yourdomain.foo/opensearch/',
b => 'AND', #
:SocketClient;
use strict;
use warnings;
our $VERSION = '0.01';
use IO::Socket;
use JSON qw(encode_json decode_json);
use MIME::Base64 qw(encode_base64);
use DeathByCaptcha::Exception;
use base 'Dea
DeathByCaptcha::Client::API_VERSION,
"cmd" => $cmd};
my $request = encode_json($cmdargs);
#printf("%d SEND: %d %s\n", time, length($request), $request);
$request .= +AP
\n", time, length($buff), $buff);
my $response;
eval { $response = decode_json($buff); };
if (defined $response) {
if (defined $response->{"error"})
'rw', isa => 'ArrayRef', default => sub {[]} );
coerce 'HashRef'
=> from 'Str'
=> via { JSON->new->utf8->decode($_) };
has payload => (
is => 'rw',
isa => 'HashRef',
coerce => 1
l be coerced using JSON decoder.
This is read-only.
=head2 frame
Raw stomp frame representing the job.
This is read-only.
=head1 METHODS
=head2 encode
String representation(JSON) to be used on th
se JSON;
use feature qw/say/;
extends qw/Test::Chado::DBManager::Pg/;
sub _build_dbh {
my ($self) = @_;
my $ua = HTTP::Tiny->new(
default_headers => { 'Accept' => 'application/json' }
e "status: $response->{status}\treason: $response->{reason}\n";
}
my $resp_hash = decode_json $response->{content};
my $dsn
= "dbi:Pg:dbname=$resp_hash->{dbname};host=$resp_hash->
package WebService::OANDA::ExchangeRates::Response;
use Moo;
use HTTP::Response;
use JSON::XS qw{decode_json};
use Try::Tiny;
has http_response => (
is => 'rw',
handles => {
is_suc
s => 'rw' );
sub BUILD {
my $self = shift;
my $data;
try {
$data = JSON::XS::decode_json( $self->raw_data );
}
catch {
$data = {
code => undef,
ent(%s): $%s', $self->raw_data, $_
)
};
# if we failed to decode the json on a successful query, we'll consider
# this an outlier and force a 500
if ($self
JSON qw(decode_json);
use DeathByCaptcha::Exception;
use base 'DeathByCaptcha::Client';
use constant API_SERVER_URL => 'http://api.dbcapi.me/api';
use constant API_RESPONSE_TYPE => 'application/json
ccess forbidden, check your credentials"
);
}
my $user;
eval { $user = decode_json($response->content()); };
return (defined $user and 0 < $user->{"user"}) ? $user : undef;
}
Status::RC_OK == $response->code) {
my $captcha;
eval { $captcha = decode_json($response->content); };
if (defined $captcha and 0 < $captcha->{"captcha"}) {
}
);
post '/cvterms' => [ format => [qw/json/] ] => sub {
my $self = shift;
my $params = $self->req->json;
for my $p (qw/namespace id name/) {
}
);
$self->res->headers->location( "/cvterms/" . $params->{id} . ".json" );
$self->rendered(201);
};
$app->start;
During the unit testing, the B<schema
Test::Mojo->new;
$t->app->schema($schema);
my $post = $t->post_ok(
'/cvterms.json' => json => {
namespace => 'test-chado-mojoapp',
id => 'TC:000001',
vailable in JSON, with the additional limitation that only simple keys are
supported.
As a result, all possible Tiny YAML documents should be able to be transformed
into an equivalent JSON document,