ersion_ok new_version_ok);
use File::Find ();
use File::Spec;
use Encode ();
use HTTP::Tiny;
use JSON::MaybeXS ();
use version ();
use Module::Metadata;
use List::Util;
use CPAN::Meta 2.120920;
use T
my ($module_metadata, $pkg) = @_;
my $res = HTTP::Tiny->new->get("http://cpanidx.org/cpanidx/json/mod/$pkg");
return (0, 'index could not be queried?') if not $res->{success};
my $data =
$data = Encode::decode($charset, $data, Encode::FB_CROAK);
}
my $payload = JSON::MaybeXS::decode_json($data);
return (0, 'invalid payload returned') unless $payload;
return (1, 'no
#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
= '0.000002';
use Moo;
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Request;
use JSON qw{ from_json to_json };
use MIME::Base64 qw{ encode_base64 };
use String::CamelCase qw{ decamelize };
has
'Content-Type' => 'application/json',
);
},
);
sub request {
my ( $self, $method, $uri, $data ) = @_;
my $content = $data ? to_json $data : undef;
my $req = HTTP::Re
self->headers,
$content,
);
my $res = $self->ua->request($req);
return from_json $res->content;
}
1;
# ABSTRACT: Net::Iugu::Request - General HTTP requests to Iugu API
__END__
ict;
use warnings;
use parent qw(HTML::Mason::Plugin);
use Time::HiRes qw(time);
use JSON;
my $json = JSON->new->convert_blessed(1)->allow_blessed(1)->allow_unknown(1)->utf8(1);
sub start_com
ame->{end} = time();
$frame->{duration} = $frame->{end} - $frame->{start};
$frame->{args} = $json->encode($context->args);
}
sub end_request_hook {
my ($self, $context) = @_;
$env{main
'Net::Iugu::Request';
use HTTP::Headers;
use HTTP::Request;
use File::LibMagic;
use JSON qw{ from_json to_json };
use File::Slurp qw{ read_file };
use MIME::Base64 qw{ encode_base64 };
sub create_
>new(
'Authorization' => $auth,
'Content-Type' => 'application/json',
);
my $content = to_json $data;
my $req = HTTP::Request->new(
POST => $uri,
$hea
ders,
$content,
);
my $res = $self->ua->request($req);
return from_json $res->content;
}
sub account_info {
my ( $self, $account_id ) = @_;
my $uri = $self->base_uri .
package Geo::Coder::Bing;
use strict;
use warnings;
use Carp qw(carp croak);
use Encode ();
use JSON;
use LWP::UserAgent;
use URI;
our $VERSION = '0.13';
$VERSION = eval $VERSION;
sub new {
my
es v1 geocodeservice geocodeservice.asmx Geocode
));
$uri->query_form(
format => 'json',
# Note: the quotes around the location parameter are required.
query => qq("$
return unless $res->is_success;
# Change the content type of the response from 'application/json' so
# HTTP::Message will decode the character encoding.
$res->content_type('text/plain');
package WebService::JotForm;
use strict;
use warnings FATAL => 'all';
use Moo;
use JSON::MaybeXS;
use LWP::UserAgent;
use URI::Escape qw(uri_escape);
use Carp qw(croak);
=head1 NAME
WebService::Jot
in wrapper around the JotForm API. All results are what's returned by the JotForm API,
with the JSON being converted into Perl data structures.
You need a JotForm API key to use this module. The e
'ro', default => 'v1');
has 'agent' => ( is => 'rw'); # Must act like LWP::UserAgent
my $json = JSON::MaybeXS->new;
sub BUILD {
my ($self) = @_;
if(not $self->agent) {
$self->agent(LWP::U
jproperties => {
data_type => "text",
is_nullable => 1,
serializer_class => "JSON"
},
...,
);
with 'DBIx::Class::InflateColumn::Serializer::Role::HashContentAccessor' => {
umn::Serializer|DBIx::Class::InflateColumn::Serializer>
- Inflators for data structures, uses eg. JSON to store the data in the database.
=item *
L<DBIx::Class::InflateColumn::Serializer::Hstore|DBI
our $VERSION = '0.02';
$VERSION = eval $VERSION;
use Role::Tiny ();
use Test::Mojo;
use Mojo::JSON 'j';
sub import {
my ($class, @roles) = @_;
@roles = map { s/^\+// ? $_ : "Test::Mojo::Role:
================================================
#
# DESCRIPTION: Deserialize to mixied XML and JSON
#
# AUTHOR: Aliaksandr P. Zahatski, <zahatski@gmail.com>
#================================
==========================================
=head1 NAME
Flow::From::JXML - deserialize flow from JSON+XML
=head1 SYNOPSIS
my $f2 = create_flow(
FromJXML => \$str2,
Split =>
;
=head1 DESCRIPTION
Flow::To::JXML - serialize flow to JSON+XML
=cut
package Flow::From::JXML;
use strict;
use warnings;
use JSON;
use Flow::To::XML;
use Data::Dumper;
use base 'Flow::From::X
$VERSION = '0.03';
# -------------------------------------
# Library Modules
use IO::File;
use JSON::XS;
use Labyrinth;
use Labyrinth::Variables;
# -------------------------------------
# The Subs
ributes hash
my $atts = {
pathfile => $pathfile || $settings{pathfile} || './pathfile.json'
};
# create the object
bless $atts, $class;
$atts->load;
return $atts;
};
lf->{pathfile},'r') or return;
local $/ = undef;
my $json = <$fh>;
$fh->close;
eval {
my $data = decode_json($json);
$self->{data} = $data->{paths};
};
return
==================================================
#
# DESCRIPTION: Serialize to mixied XML and JSON
#
# AUTHOR: Aliaksandr P. Zahatski, <zahatski@gmail.com>
#================================
);
=head1 DESCRIPTION
Flow::To::JXML - serialize flow to JSON+XML
=cut
package Flow::To::JXML;
use strict;
use warnings;
use JSON;
use Flow::To::XML;
use base 'Flow::To::XML';
our $VERSION = '
hift;
my $xfl = $self->{_xml_flow};
$xfl->startTag("flow");
$xfl->_get_writer->cdata(JSON->new->utf8->pretty(1)->encode(\@_));
$xfl->endTag("flow");
return $self->Flow::flow(@_)
alize your data, without requirement
to do so in XML, you should probably better have a look at L<JSON::XS>
or L<Storable>.
=cut
use warnings;
use strict;
use utf8;
use 5.010;
use feature 'state';
g enough?)
* XSD
* anyone else has an idea?
* what to do with blessed? do the same as JSON::XS does?
=head1 BUGS
Please report any bugs or feature requests to C<bug-data-asxml at rt.cpan
with 'Articulate::Role::Component';
with 'Articulate::Role::Storage';
use Articulate::Syntax;
use JSON;
use Scalar::Util qw(blessed);
=head1 NAME
Articulate::Content::DBIC::Simple - store your conte
Schema::Result::Articulate::Item>,
and rows contain meta, content and location. Meta is stored in JSON.
It is left up to the application, not the database to maintain
referential integrity (although
lf->construction->construct(
{
location => $dbic_item->location,
meta => from_json( $dbic_item->meta ),
content => $dbic_item->content,
}
);
}
sub real_to_dbic { # in
ExtJS2
Controller::DisplayEngine::Skinny
Model::StorageEngine::DBIC
View::JSON
View::TT
);
# will auto-load other models, so this one is not -required-
if
yst::View::JSON until it is fixed, or users will get scared
# by the warning currently emitted by Catalyst
use Catalyst::View::JSON;
my $json_new = _get_subref('new', 'Catalyst::View::JSON');
{
n
o warnings 'redefine';
*Catalyst::View::JSON::new = sub {
delete $_[2]->{catalyst_component_name};
goto $json_new;
};
}
sub _get_subref {
my $sub = shift;
my $pkg = sh
# TODO: Write better/more test cases
use 5.006;
use strict;
use warnings;
use REST::Client;
use JSON;
use Data::Dumper;
use YARN::YarnClient;
BEGIN {
$YARN::VERSION = '0.1';
}
our $client = '';
path( $self, $api ) )->responseContent();
if (defined $element) {
return $self->findElementInJSON( $rest, $apis{$api}, $element );
} else {
return $rest;
}
}
sub info { shift->__req_api( 'i
f = shift;
my $req = $self->scheduler();
}
sub findElementInJSON {
my ($self, $rest, $root, $element) = @_;
my $res = decode_json $rest;
return $res->{$root}->{$element};
}
=head1 NAME
YA
->{cols}};
# filter data types coming from the db for Ext
foreach my $row (@{$c->stash->{json_data}->{rows}}) {
foreach my $col (@columns) {
my $ci = $meta->f->{$col};
earchrow{$col} = '(click to add filter)';
}
}
}
unshift @{$c->stash->{json_data}->{rows}}, \%searchrow;
}
sub filter_from_ext : Private {
my ($self, $c) = @_;
my $
r} = $dir;
$c->stash->{cpac}->{g}->{frontend} = 'skinny';
}
# pull in data by forwarding to JSON .../list, then send page and render
sub browse : Chained('base') Args(0) {
my ($self, $c) = @
ew;
$pager->total_entries($c->stash->{json_data}->{total});
$pager->entries_per_page($c->stash->{cpac_skinny_limit} eq 'all'
? $c->stash->{json_data}->{total} : $c->stash->{cpac_skinny
on-matching provides
=head1 DESCRIPTION
This distribution has a valid C<provides> entry in META.json and
META.yml with mis-matching entries with the C<.pm> files.
=over 4
=item *
CPAN::Test::Dumm
8001;
use strict;
use warnings;
our $VERSION = "0.02";
use JSON::XS ();
use JSON::Color ();
my $_coder;
sub _coder {
$_coder ||= JSON::XS->new->pretty(1);
}
sub new_with_options {
my ($cla
lf, $json) = @_;
($self->{printer} ||= do {
!$self->{color} ? sub { chomp(my $l = $_coder->encode(shift)); $l} : sub { JSON::Color::encode_json(shift, {pretty => 1}) }
})->($json);
}
{
my $pre = $`;
my $maybe_json = $&;
my $post = $';
my $json;
eval {
$json = _coder->decode($maybe_json);
};
if (!$@) {