int format_pretty($data);
# explicitly select a formatter
print format_pretty($data, {module=>'JSON'});
# specify formatter option(s)
print format_pretty($data, {module=>'Console', interactive=>
use.
To develop a formatter, look at one of the formatter modules (like
L<Data::Format::Pretty::JSON>) for example. You only need to specify one
function, C<format_pretty>.
=head1 FUNCTIONS
=head2
er, like L<Data::Format::Pretty::Console>,
L<Data::Format::Pretty::HTML>, L<Data::Format::Pretty::JSON>,
L<Data::Format::Pretty::YAML>.
Alternative data formatting framework/module family: L<Any::Ren
package Net::Heroku;
use Mojo::Base -base;
use Net::Heroku::UserAgent;
use Mojo::JSON;
use Mojo::Util 'url_escape';
our $VERSION = 0.10;
has host => 'api.heroku.com';
has ua => sub { Net::Heroku::Us
n if $res->code =~ /^2\d{2}$/;
return (
code => $res->code,
message => ($res->json ? $res->json->{error} : $res->body)
);
}
sub _retrieve_api_key {
my ($self, $email, $password) = @
l => $email, password => $password})
->res->json('/api_key');
}
sub apps {
my ($self, $name) = @_;
return @{$self->ua->get('/apps')->res->json || []};
}
sub app_created {
my ($self, %para
package Net::Groonga::HTTP::Response;
use strict;
use warnings;
use utf8;
use JSON::XS qw(decode_json);
use Data::Page;
use Net::Groonga::Pager;
use Mouse;
has function => (
is => 'rw',
requ
e->code ne 200;
return $self->http_response->content if $self->function eq 'dump';
decode_json($self->http_response->content);
}
sub return_code {
my $self = shift;
Carp::croak(sprint
ethods return method dies if the response is not I<200 OK>.
=over 4
=item $res->data() :Object
JSON decoded content body.
=item $res->return_code() :Int
Shorthand for C<< $res->data->[0]->[0] >>.
am|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|a
update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouse
cified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,
. $path
)
);
# Headers
$self->tx->req->headers->header(Accept => 'application/json');
return $self->tx;
}
1;
=head1 NAME
Net::Heroku::UserAgent
=head1 DESCRIPTION
Subclass
collections
=cut
package Collection::CrcColl;
use strict;
use warnings;
use String::CRC32;
use JSON::XS;
use Collection::AutoSQL;
our @ISA = qw(Collection::AutoSQL);
our $VERSION = '0.11';
sub raw
( raw2hex) BINARY
refhash => { var1=>'1', var2=>0} string ('var1=0 , var=2')
json => string json serialized
=cut
sub _create {
my ( $self, %arg ) = @_;
my $table_name = $self-
d=0'
$val ={ map { split/=/,$_ } split /,/, $val };
}
if ($type eq 'json' ) {
unless ($val) {
$val = {}
} else {
#
subdomain' => (is => 'rw', isa => 'Str');
has 'xml' => (is => 'rw', isa => 'Str');
has 'json' => (is => 'rw', isa => 'Str');
has 'formid' => (is => 'rw', isa => 'Str');
has 'pret
RSION = '0.007';
}
use diagnostics;
use Moose;
use WWW::WuFoo::Field;
use WWW::WuFoo::Entry;
use JSON;
use Data::Dumper;
# ABSTRACT: The Forms API is used to gather details about the forms you have
($pagestart == 0 || $entries > 0) {
my $url = '/api/v3/forms/' . $self->hash . '/entries.json?pageSize=100&pageStart=' . $pagestart;
my $ref = $self->_wufoo->do_request($url)->{Entrie
{
my ($self) = @_;
my @arr;
my $url = '/api/v3/forms/' . $self->hash . '/fields.json';
my $ref = $self->_wufoo->do_request($url)->{Fields};
# my $orderby = 0;
foreach my
$WWW::WuFoo::VERSION = '0.007';
}
use strict;
use warnings;
use Moose;
use LWP::UserAgent;
use JSON;
use WWW::WuFoo::Form;
use WWW::WuFoo::User;
use Data::Dumper;
# ABSTRACT: Interface to WuFoo.c
ash eq $opts{hash};
}
}
sub forms {
my ($self, $opts) = @_;
my $url = '/api/v3/forms.json?IncludeTodayCount=true';
my @arr;
my $obj = $self->do_request($url)->{Forms};
forea
return \@arr;
}
sub users {
my ($self) = @_;
my @arr;
my $url = '/api/v3/users.json';
my $users = $self->do_request($url)->{Users};
foreach my $user (@$users) {
my $
package Net::Nakamap;
use 5.008_001;
use HTTP::Request::Common;
use JSON::XS;
use LWP::UserAgent;
use Mouse;
our $VERSION = '0.03';
has ua => (
is => 'rw',
lazy => 1,
default =>
,
);
my $res = $self->ua->post($uri);
if ($res->is_success) {
return decode_json($res->content);
}
else {
$self->last_error($res->content);
return undef;
s,
);
my $res = $self->ua->get($uri);
if ($res->is_success) {
return decode_json($res->content);
}
else {
$self->last_error($res->content);
return undef;
package Graph::D3;
use strict;
use 5.008_005;
our $VERSION = '0.03';
use Moo;
use JSON;
use Graph;
has graph => (
is => 'ro',
required => 1
);
has type => (
is => 'ro',
default =>
}
my $output = { nodes => \@nodes, links => \@links };
return $self->type eq 'json' ? encode_json $output : $output;
}
# http://mbostock.github.io/d3/talk/20111116/bundle.html
sub hierar
mports };
}
return $self->type eq 'json' ? encode_json \@bundle : \@bundle;
}
1;
__END__
=encoding utf-8
=head1 NAME
Graph::D3 - Create ref/json to show node-edge graph with D3.js
=head
'map' => {
'text/x-yaml' => 'YAML',
'application/json' => 'JSON',
'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
},
)
N = '0.000000_03';
}
# ABSTRACT: A list of a repository's hooks
use common::sense;
use autobox::JSON;
use parent 'GitHub::API::Base';
#use aliased 'GitHub::API::Hook';
# debugging...
#use Smart::
Hub::API;
use autobox::JSON;
say GitHub::API
->new
->user
->repo("moosex-attributeshortcuts")
->hooks
->all
->to_json
;
=head1 DESCRIP
N = '0.000000_03';
}
# ABSTRACT: A list of a repository's hooks
use common::sense;
use autobox::JSON;
use parent 'GitHub::API::Base';
# debugging...
#use Smart::Comments '###';
#sub test { ... }
b::API::Base;
{
$GitHub::API::Base::VERSION = '0.000000_03';
}
use common::sense;
use autobox::JSON;
# ABSTRACT: Base class for GitHub::API classes
# debugging...
#use Smart::Comments '###';
sub
>{url},
{ headers => $self->{headers} },
)
->{content}
->from_json
;
return ref $items eq 'ARRAY' ? $items : [ $items ];
}
sub _post {
my ($self,
->{ua}
->post($url, { content => $content->to_json, headers => $self->{headers} })
;
return $resp->{content}->from_json;
}
sub _delete {
my ($self, $content, $path_part) =
Nakanobu;
use strict;
use warnings;
use base qw/Class::Component::Plugin/;
use JSON::RPC::Common::Marshal::HTTP;
use JSON::RPC::Common::Procedure::Call;
use YAML ();
use LWP::UserAgent;
use Text::Trun
my ($method, $params, $entry_url, $timeout) = @_;
my $marshal = JSON::RPC::Common::Marshal::HTTP->new();
my $call = JSON::RPC::Common::Procedure::Call->new(
method => $method,
warnings FATAL => 'all';
use LWP::UserAgent;
use URL::Encode 'url_encode';
use Data::Dumper;
use JSON;
=head1 NAME
Microsoft::Azure::AccessToken - Microsoft Azure Access Token implementation
=head
) {
my $resturn = undef;
my $content = $response->decoded_content;
my $js = eval { decode_json( $content ) };
if ( $@ ) {
print STDERR "Unable to parse response\n";
return undef;
}
e utf8;
use WWW::Mechanize;
use HTML::TreeBuilder::XPath;
use HTML::Entities;
use JSON;
my $statusLogin;
my $statusLoginRegistro;
my $entitieschars;
my $mech;
douro, $tipoendereco, $logradouro, $numero, $complemento, $bairro, $cep, $uf, $cidades );
Return JSON
{"nome":"Fulano de Tal","resposta":"registrado","status":"sucesso","codigo":"107630"}
{"
nnection;
use MonitisMonitorManager::M3Logger;
use Carp;
use Date::Manip;
use File::Basename;
use JSON;
use Data::Dumper;
#################
### CONSTANTS ###
#################
require Exporter;
our
formatted_results = format_results(\%results);
my $formatted_additional_results = format_results_json(\%additional_results);
return $self->update_data_for_monitor(
agent_name => $agent_name,
mo
s;
}
# formats the hash of results into a string
sub format_results_json(%) {
my (%results) = %{$_[0]};
return "[" . encode_json(\%results) . "]";
}
# simply replaces the %SOMETHING% with the rele