only to retrieve prerequisites
=head3 L<GraphViz>
=head2 Only necessary if you want JSON graphing
=head3 L<JSON::XS>
=head1 AUTHOR
Nathan Glenn <garfieldnate@gmail.com>
=head1 COPYRIGHT AND LICE
::Role;
use Carp qw{carp cluck croak confess};
use English qw{-no_match_vars};
use Readonly;
use JSON;
our $VERSION = 0.27;
Readonly::Scalar our $ATTRIBUTE_METACLASS_TO_SKIP => q[MooseX::Getopt::Me
irst level of references will be passed through, multi-dimensional data structures
should use the json serialisation option and deserialise it on object construction or script
running
my $command_l
s_as_json
returns all the built attributes that are not objects as a JSON string
my $sAttributesAsJSON = $class->attributes_as_json();
=head2 attributes_as_escaped_json
as attributes_as_json, ex
se 5.000001;
use strict;
use warnings;
use Socket; # Leap communicates over WebSockets
use JSON; # ... in JSON
require Exporter;
our @ISA = qw(Exporter);
# Items to export into callers namespace by
too much data came in to process all at once - some got truncated...
} else {
$ret=from_json($ret);
}
}
return $ret;
} # Leap
1;
__END__
=head1 NAME
Device::Leap - Perl interf
This module requires these other modules and libraries:
Socket (already part of perl itself)
JSON
=head1 SEE ALSO
See the Leap Motion web site: https://leapmotion.com/ for links to
the develope
L::TreeBuilder;
use LWP::UserAgent;
use HTTP::Cookies;
use XML::Twig;
use Carp 'croak';
use JSON 'decode_json';
our $VERSION = 'v0.3.7';
=head1 NAME
WWW::Fimfiction - CRUD tasks for fimfiction.net
@_;
my $res = $self->_get("http://www.fimfiction.net/api/story.php?story=$id");
return decode_json($res->decoded_content)->{story};
}
=head1 AUTHOR
Cameron Thornton E<lt>cthor@cpan.orgE<gt>
=he
ct;
use warnings;
package CouchDB::Utils::App::Command::load;
use App::Cmd::Setup -command;
use JSON;
use MIME::Base64;
use File::Basename;
use File::Slurp qw(read_file);
use File::Spec::Functions q
$uri->port($opt->{port});
$uri->path($name);
}
my $db = couchdb($uri->as_string);
my $json = JSON->new->allow_nonref->pretty;
my @docs;
opendir (my $dh, $path) || die $!;
while (my $f = r
my $doc_path = catfile($path, $id, 'doc');
open DOC, ">$doc_path" or die $!;
print DOC $json->encode($doc);
close DOC;
} elsif ($load->{error}) {
warn "$load->{id} $load->{error}: $
SCRIPTION
L<Pushwoosh|http://www.pushwoosh.com/> is a push notification service which
provides a JSON API for users of its premium account. This module provides a
simple Perl wrapper around that API.
the possible error codes.
=back
=cut
our $VERSION = '0.02';
use Carp;
use Furl;
use JSON qw(from_json to_json);
use Params::Validate qw(validate validate_with validate_pos :types);
use Try::Tiny;
@_,
{ app_code => 1,
api_token => 1,
api_url => { default => 'https://cp.pushwoosh.com/json/1.3' },
furl => 0,
error_mode => { default => 'croak' },
}
);
$args{furl} ||= Furl
cover -report phabricator
=head1 DESCRIPTION
By default, this module generates a C<phabricator.json> file in
L<Devel::Cover>'s output directory. This file can then be parsed and used to
provide cov
upported by this report are:
=over
=item outputfile
The file to write the JSON report to. Defaults to I<phabricator.json> in the report directory.
=back
=head1 SEE ALSO
L<Devel::Cover>
L<Devel:
;
use 5.006;
our $VERSION = '0.01';
use Getopt::Long;
use File::Slurp qw(write_file);
use JSON qw(to_json);
use List::MoreUtils qw(any);
sub get_options {
my ($self, $opt) = @_;
$opt->{option} |
arnings;
package CouchDB::Utils::App::Command::dump;
use App::Cmd::Setup -command;
use URI;
use JSON::XS;
use File::Path qw(mkpath);
use File::Spec::Functions qw(rel2abs catdir catfile);
use AnyEven
sub execute {
my ($self, $opt, $args) = @_;
## this will be used to pretty format json
my $json = JSON->new->allow_nonref->pretty;
my $name = $args->[0]; ## database name
## unspecified
=> $start, ids => \@ids };
}
## pretty json formating makes it easier to edit the docs once
## they are on the file system
my $pretty_doc = $json->encode($doc);
_dump(catfile($doc_dir,'do
package WWW::Mailchimp;
use Moo;
use LWP;
use JSON;
use URI;
use PHP::HTTPBuildQuery qw(http_build_query);
use MooX::Types::MooseLike::Base qw(Int InstanceOf Num Str);
use Sub::Name;
our $VERSION = '
himp->new(apikey => $apikey);
# defaults ( datacenter => 'us1', timeout => 5, output_format => 'json', api_version => 1.3 )
my $campaigns = $mailchimp->campaigns;
my $lists = $mailchimp->lists;
on by default. This is also uri_escaped
=head1 BUGS
Currently, this module is hardcoded to JSON::from_json the result of the LWP request.
This should be changed to be dependent on the output_format.
original data.
There are several well-known serialization method, such as L<Data::Dumper>,
L<JSON>, L<YAML>, L<PHP::Serialization>, L<Data::DumpXML>, etc. Each of them
has different benefits and
its. You should read their documents
for more information.
My favorite one is L<JSON>. It will try to use L<JSON::XS> when availible.
This one is both efficient and simple. Though you can only st
lessed object,
tied data, nor references that refer to the same variable or cyclic references (L<JSON>
will extract them independently and completely).
=item base64
It's not allowed to use all
=> sub{$naptime = rand(10)},
teardown => sub{$naptime = 1},
},
);
$bench->run(3);
print $bench->report(format => 'JSON');
# [ { name => 'foo', href => 'bar' }, ]
$c->render_json( $results );
} => "$object/autocomplete");
}
}
erAgent;
use JSON;
# default options
use constant DEFAULT_USER_AGENT => 'Mozilla/5.0';
use constant DEFAULT_LANG => 'en-US';
use constant BASE_URL => 'http://imdbapi.org/?type=json';
use Obje
earch($options);
if ( $response->is_success ) {
my @results;
for ( @{ decode_json( $response->content ) } ) {
my $result = WebService::IMDBAPI::Result->new( %{$_} );
nse->is_success ) {
my $result = WebService::IMDBAPI::Result->new(
%{ decode_json( $response->content ) } );
return $result;
}
else {
die $response->status
}
});
}
=head1 CLIENT-SIDE VALIDATION
This recipe describes how to generate JSON objects which can be used to validate
user input in the web-browser (client-side).
=head2 Proble
uration available as JSON objects in the browser.
=head2 Solution
Using introspection, you can leverage the prototype class associated with your
validation class to generate JSON objects based on yo
nt::Twitter;
use strict;
use warnings;
use utf8;
use 5.008;
our $VERSION = '0.64';
use Carp;
use JSON;
use URI;
use URI::Escape;
use Digest::SHA;
use Time::Piece;
use AnyEvent::HTTP;
use HTTP::Reques
;
our %RESOURCE_URL_BASE = (
'1.0' => 'http://api.twitter.com/1/%s.json',
'1.1' => 'https://api.twitter.com/1.1/%s.json',
);
sub new {
my ($class, %args) = @_;
$args{api_version}
my $cb = pop;
my ($self, $endpoint, $params) = @_;
my $type = $endpoint =~ /^http.+\.json$/ ? 'url' : 'api';
$self->request($type => $endpoint, method => 'GET', params => $params, $cb
package Catalyst::TraitFor::Controller::jQuery::jqGrid::Search;
use 5.008;
use Moose::Role;
use JSON;
our $VERSION = '0.02';
my %qOp = (
'eq' => { pre => '', post => '', op => '=', },
{} unless $params->{_search} eq 'true';
if ( $params->{filters} ) {
return _complex_search( JSON->new->decode( $params->{filters} ) );
}
elsif ( $params->{searchField} ) {
# Simple sear
used to page
through data obtained from a back-end database. Ajax calls to the back-end
retrieve JSON data. See L<http://www.trirand.com/blog/>
This module provides a helper function to translate th
format => 'Text'); # uses Tool::Bench::Report::Text
$bench->report(format => 'JSON'); # uses Tool::Bench::Report::JSON
By using class names you can build your own report simply, see
L<Tool::Bench:
FATAL => 'all';
use Carp 'croak';
use Digest::SHA qw(sha256_hex);
use LWP::UserAgent;
use JSON qw(decode_json);
our $VERSION = '0.04';
my $client_id;
my $client_secret;
my $scope = "";
my $github_
get("https://api.github.com/user?access_token=$acc");
my $json = decode_json($jresp->decoded_content);
session 'github_user' => $json;
session 'github_access_token' => $acc;
#session 'logg
./generate_jsapi > app.api.js
use MyApp::Introspect;
use JSON;
my $classes = {};
my $json = JSON->new->allow_blessed->convert_blessed->pretty([1]);
my $intros
ields) = each(%{$classes})) {
$namespace =~ s/::/./;
my $objects = $json->encode($fields);
chomp $objects;
print "$namespace = $objects;
' --file 't/01-works.t' --count 3 --format JSON
=head1 TODO
needs docs
=cut
die qx{perldoc $0} unless @ARGV;
my ($count,$format,$interp,$file) = (1,'JSON'); #supply defaults;
my $opt = GetOptions