you can pass URIs included by the return value of C<query> method.
=back
=head1 EXAMPLES
use JSON::Path qw/jpath_map/;
use Time::Piece qw/gmtime/;
# convert start times for games into Time:
head1 NAME
DJSON - Decommisioned. Use JSONY.pm instead.
=for html
<a href="https://travis-ci.org/ingydotnet/djson-pm"><img src="https://travis-ci.org/ingydotnet/djson-pm.png" alt="djson-pm"></a>
<a
ngydotnet/djson-pm?branch=master"><img src="https://coveralls.io/repos/ingydotnet/djson-pm/badge.png" alt="djson-pm"></a>
=head1 SYNOPSIS
use DJSON;
my $data = decode_djson $djson_string;
=head1 DESCRIPTION
DJSON is a data language that is simlar to JSON, just more chill. All valid
JSON is also valid DJSON (and represents the same thing when decoded), but
DJSON lets you omit a lot of
ockIO;
use 5.006;
use strict;
use warnings FATAL => 'all';
use Carp;
use WWW::Curl::Simple;
use JSON;
use Exporter 'import';
our @EXPORT_OK = qw(get_new_address
get_my_addresses
aw_from_user
get_current_price);
=head1 NAME
Finance::BlockIO - Perl wrapper to JSON-based Block.io API
=head1 VERSION
Version 0.01
=cut
our $VERSION = '0.02';
=head1 SYNOPSIS
provides a bare interface to the Block.io JSON-based API,
using WWW::Curl::Simple to make requests and returning a Perl data structure
created from any JSON response received.
You'll probably need a
e strict;
use 5.10.0;
use Carp;
use JSON;
use ZMQ::LibZMQ3;
use ZMQ::Constants qw(ZMQ_REP);
our $VERSION = "2.000000";
$VERSION = eval $VERSION;
my $json = JSON->new->utf8->convert_blessed;
my $MAX
>
and L<mcbain-zmq-client>, respectively.
The workers created by this module receive payloads in JSON format, and convert them into the
hash-refs your API's methods expect to receive. The payload mu
o the clients in JSON as well. Note that if an API method does not return a hash-ref, this runner
module will automatically turn it into a hash-ref to ensure that conversion into JSON will
be possible
easily find data, that you
can subsequently display. You can also use REST APIs that offer JSON but not
JSONP, directly from JavaScript.
=head1 CREDIT
This is just a simple way to use L<Plack::App:
JSONP;
use Plack::Middleware::Static;
use Plack::App::unAPI qw(0.3);
use File::ShareDir qw(dist_dir);
use Plack::Util;
use Carp qw(croak);
use Scalar::Util qw(blessed reftype);
use Try::Tiny;
use JSON
$self->query(@_) } ), $f->type ];
my $app = unAPI( %formats );
$app = Plack::Middleware::JSONP->wrap($app);
if ($self->{Stylesheet}) {
$app = Plack::Middleware::Static->wrap( $ap
ostray;
$App::Nostray::VERSION = '1.01';
use File::Next;
use Getopt::Std;
use JavaScript::V8;
use JSON;
use File::Slurp;
=head1 NAME
App::Nostray - Detect and eliminate stray commas in Javascript so
;
use Plack::App::WebSocket;
use Scalar::Util qw(weaken refaddr);
use Try::Tiny;
use JSON qw(decode_json encode_json);
our $VERSION = "0.03";
sub new {
my ($class, @args) = @_;
my $self = $c
e_str) = @_;
return if !$self;
try {
my $message = decode_json($message_str);
if(!ref($message) || ref($message) ne "HASH") {
> sub {
my ($send_message) = @_;
try {
$conn->send(encode_json($send_message));
}catch {
my $e = shift;
return !$sel
N
Version 0.003
=head1 SYNOPSIS
my $api = Net::Async::SPORE::Loader->new_from_file(
'sample.json',
transport => 'Net::Async::HTTP',
class => 'Sample::API',
);
$api->some_request(x => 1
classes in memory.
=cut
use Net::Async::SPORE::Request;
use Net::Async::SPORE::Definition;
use JSON::MaybeXS;
use File::Spec;
sub inject_method(&@);
=head1 METHODS
=cut
=head2 new_from_file
In
w API object from the given file.
my $api = Net::Async::SPORE::Loader->new_from_file(
'sample.json',
transport => 'Net::Async::HTTP',
class => 'Sample::API',
);
$api->some_request(x => 1
SCRIPTION
No user-serviceable parts inside. See L<Net::Async::SPORE::Loader> instead.
=cut
use JSON::MaybeXS;
=head2 new
Instantiates this object.
=cut
sub new { my $class = shift; bless { @_ }
eq) = @_;
$self->_transport->do_request(
request => $req
)->transform(
done => sub { decode_json(shift->content) }
)
}
1;
__END__
=head1 AUTHOR
Tom Molesworth <cpan@perlsite.co.uk>
=head1
to the API for Todoist (a to-do list service)
use strict;
use warnings;
use LWP::UserAgent;
use JSON::XS;
use Carp 'croak';
use vars qw/$errstr/;
sub new {
my $class = shift;
my $args = sca
$args->{ua} = LWP::UserAgent->new(%$ua_args);
}
unless ( $args->{json} ) {
$args->{json} = JSON::XS->new->utf8->allow_nonref;
}
bless $args, $class;
}
sub errstr { $e
'LOGIN_ERROR' ) {
$errstr = $resp->content;
return;
}
my $data = $self->{json}->decode( $resp->content );
$self->{token} = $data->{api_token};
return $data;
}
sub get
> utility for running methods
against a SPORE definition from the commandline:
spore -s github.json list_repos username=tm604
=cut
1;
__END__
=head1 SEE ALSO
=head1 AUTHOR
Tom Molesworth <cpa
around Gerrit's REST API
use 5.010;
use utf8;
use strict;
use warnings;
use Carp;
use URI;
use JSON;
use Data::Util qw/:check/;
use REST::Client;
sub new {
my ($class, $URL, $username, $passwo
ication by default
$rest->setFollow(1);
# Request compact JSON by default
$rest->addHeader('Accept' => 'application/json');
# Configure UserAgent name and password authentication
Code Review', $username, $password);
}
return bless {
rest => $rest,
json => JSON->new->utf8->allow_nonref,
} => $class;
}
sub _error {
my ($self, $content, $type, $c
Archives;
use strict;
use warnings;
use 5.10.0;
use Carp;
use LWP::UserAgent;
use URI;
use JSON qw(decode_json);
our $VERSION = '0.03';
sub new {
my ($class, %args) = @_;
if(!defined($args{u
!$res->is_success) {
croak "Network Error: " . $res->status_line;
}
return decode_json($res->content);
}
1;
__END__
=pod
=head1 NAME
WebService::Lingr::Archives - load archived me
package Net::Twitter::Loader;
use strict;
use warnings;
use JSON qw(decode_json encode_json);
use Try::Tiny;
use Carp;
use Time::HiRes qw(sleep);
our $VERSION = "0.04";
our @CARP_NOT = qw(Try::Tiny
$self->{filepath} or return undef;
my $json_text = do { local $/ = undef; <$file> };
close $file;
my $since_ids = try {
decode_json($json_text);
}catch {
my $e = shift;
$self->_log("warn", "failed to decode_json");
return {};
};
$since_ids = {} if not defined $since_ids;
return $since_ids;
}
sub _log {
my ($self, $level, $msg) = @_;
ckage RDF::NLP::SPARQLQuery::Query;
use utf8;
use strict;
use warnings;
use Data::Dumper;
# use JSON:PP;
use HTTP::Request;
use LWP::UserAgent;
use URL::Encode;
# use XML::Simple;
use Storable qw (
pe', 'application/json' ]]);
wait_for_events(sub {
my $new_event = shift;
if ($new_event) {
$writer->write($new_event->as_json . "\n");
::Harness;
use strict;
use warnings;
use utf8;
use FindBin;
use Config;
# build requirements
use JSON::XS ();
use Test::Deep ();
use Test::Simple ();
use File::Temp ();
use Test::More ();
use Test::M
:Journal;
use App::MtAws::MetaData;
use App::MtAws::DateTime;
use App::MtAws::Glacier::Inventory::JSON;
use App::MtAws::Glacier::Inventory::CSV;
use App::MtAws::QueueJob::FetchAndDownloadInventory;
ttachmentref) = @_;
my $data = do {
if ($inventory_type eq INVENTORY_TYPE_JSON) {
App::MtAws::Glacier::Inventory::JSON->new($$attachmentref)
} elsif ($inventory_type eq INVENTORY_TYPE_CSV) {
my $message = shift;
my $body = [ $message->to_json ];
$respond->([200, ['Content-Type', 'application/json'], $body]);
});
};
};
C<wait_for_new_messag
my $message = shift;
if ($message) {
$writer->write($message->to_json);
} else {
$writer->close;
}
});
};