strict;
use Mojo::Autobox;
# "site.com\n"
'{"html": "<a href=\"http://site.com\"></a>"}'
->json('/html')
->dom->at('a')->{href}
->url->host
->byte_stream->say;
=head1 DESCRIPTION
Usi
for most purposes like
* string and INI processing, ZIP extracting, Base64 encoding/decoding, JSON encoding/decoding
* and so forth.
* If this directive is enabled, then all built-in Jx9 funct
ey,int nKeyLen);
UNQLITE_APIEXPORT int unqlite_kv_config(unqlite *pDb,int iOp,...);
/* Document (JSON) Store Interfaces powered by the Jx9 Scripting Language */
UNQLITE_APIEXPORT int unqlite_compile(
(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_json_array(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_json_object(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_va
ge Bio::Taxonomy::GlobalNames;
use 5.10.0;
use strict;
use warnings;
use JSON qw(encode_json);
use JSON::Parse qw(parse_json);
use LWP::UserAgent;
use Moo::Lax;
use REST::Client;
use Scalar::Readonl
sing a REST client,
input is sent to the service, whereas results are internally converted
from JSON format to nested objects and returned to the user.
This module can be used for automated standar
resolvers.json';
}
elsif ( _check_status('http://resolver.globalnames.biodinfo.org') )
{
$gnr_url =
'http://resolver.globalnames.biodinfo.org/name_resolvers.json';
}
package Mojo::Autobox::Hash;
use Mojo::Base -strict;
sub json {
require Mojo::JSON;
Mojo::JSON::encode_json(shift);
}
*j = \&json;
1;
=head1 NAME
Mojo::Autobox::Hash - Autobox hash methods f
ld'}->json;
=head1 DESCRIPTION
Hash methods for L<Mojo::Autobox>. These also apply to hash references.
=head1 METHODS
=head2 json
Serializes the invocant hash using L<Mojo::JSON/encode_json> and
returns the result.
=head2 j
An alias for L</json>.
et::Twitch::Oauth2;
use strict;
use warnings;
use LWP::UserAgent;
use URI;
use URI::Escape;
use JSON::Any;
use Carp;
use constant ACCESS_TOKEN_URL => 'https://api.twitch.tv/kraken/oauth2/token';
u
e from twitch
##die and display error message
my $j = JSON::Any->new;
if (!$response->is_success){
my $error = $j->jsonToObj($response->content());
croak "'" .$error->{erro
}
##everything is ok proccess response and extract access token
my $reply = $j->jsonToObj($response->content());
my $token = $reply->{access_token};
my $expires = $reply->{re
et(
'https://api.twitch.tv/kraken/user' ##Twitch API URL
);
print $info->as_json;
=head1 DESCRIPTION
Net::Twitch::Oauth2 gives you a way to simply access Twitch.tv Oauth 2.0
e returned can be formatted as the following
=over 4
=item * C<$responseE<gt>as_json>
Returns response as json object
=item * C<$responseE<gt>as_hash>
Returns response as perl hashref
=bac
package App::RunCron::Reporter::Command;
use strict;
use warnings;
use JSON::PP;
sub new {
my ($class, $command) = @_;
$command = ref $command ? $command : [$command];
bless $command, $cl
$pipe, '|-', @$self or die $!;
my $d = $runner->report_data;
$d->{is_success} = $d->{is_success} ? $JSON::PP::true : $JSON::PP::false;
print $pipe encode_json($d);
close $pipe;
}
1;
}
sub json {
require Mojo::JSON;
require Mojo::JSON::Pointer;
my $data = Mojo::JSON::decode_json(shift);
return @_ ? Mojo::JSON::Pointer->new($data)->get(shift) : $data;
}
*j = \&json;
sub
e_stream->trim;
# "Text"
'<p>Text</p>'->dom->at('p')->text;
# "world"
'{"hello": "world"}'->json->{hello};
# "anchor"
'http://mysite.com/path#anchor'->url->fragment;
=head1 DESCRIPTION
Str
ead2 json
Parses the invocant string as JSON using L<Mojo::JSON/decode_json> and returns the result.
Optionally takes a JSON pointer used to delve into the resulting structure using L<Mojo::JSON::Poi
lp of the most excellent L<JSON::XS> but it's a bit fiddly, largely
because Perl doesn't natively support data types and Google's API accepts a
super-set of JSON - see L<JSON vs Javascript> below.
Th
is module is attempts to hide the gory details of preparing your data before
sending it to a JSON serializer - more specifically, hiding some of the hoops
that have to be jump through for making sure
, C<label>, C<pattern>, and C<p> are
supported. The contents of C<p> will be passed directly to L<JSON::XS> to
serialize as a whole.
=head2 Rows
A row is either a hash-ref where the keys are column
L<DBI>
=head3 L<DBD::SQLite>
=head2 Data Manipulation
=head3 L<Const::Fast>
=head3 L<JSON>
=head3 L<JSON::XS>
=head3 L<List::MoreUtils>
=head3 L<Regexp::Common>
=head3 L<XML::LibXML>
=head3
#{
package JRPC;
use JSON::XS;
use Data::Dumper;
use strict;
use warnings;
#UNUSED:my $rstub = {'id' => 66666, 'jsonrpc' => '2.0'};
our $VERSION = '0.61';
# 0 = No validation (trust client, any excep
Require 'id','jsonrpc', 3
our $msgvalid = 1;
# This is prelogger callback. MUST be a _hard_ CODE ref to be used (not symbolic reference).
our $prelogger;
=head1 NAME
JRPC - Create JSON-RPC Services
focusing on app logic, not worrying about the details of JSON-RPC Processing.
=head1 SYNOPSIS
use JRPC;
# Load one of the Service modules JRPC::CGI, JRPC::Apache2 or JRPC::Nginx
# See part
package App::RunCron::Announcer::Command;
use strict;
use warnings;
use JSON::PP;
sub new {
my ($class, $command) = @_;
$command = ref $command ? $command : [$command];
bless $command, $c
lass;
}
sub run {
my ($self, $runner) = @_;
open my $pipe, '|-', @$self or die $!;
print $pipe encode_json($runner->announce_data);
close $pipe;
}
1;
X = '_id';
my $content_types = {
json => 'application/json',
yml => 'text/x-yaml',
xml => 'application/xml',
dump => 'text/x-perl',
jsonp => 'text/javascript',
};
my %trigg
ub () {
my $conf = plugin_setting;
my $serializers = {
'json' => 'JSON',
'jsonp' => 'JSONP',
'yml' => 'YAML',
'xml' => 'XML',
'dump' => 'Du
$routes{$action} } => $triggers_map{get}
->( qr{$route/\Q$action\E\.(?<format>json|jsonp|yml|xml|dump)}
=> $sub );
push @{ $routes{$action} } =>
mon::sense;
our $VERSION = '0.200';
use AnyEvent;
use AnyEvent::Util;
use AnyEvent::Handle;
use JSON::XS;
use File::ShareDir;
use Scalar::Util;
use Alien::Thrust;
use Thrust::Window;
our $THRUST
($level, $msg_cb, $to_dump, $indent) = @_;
return if $level > $ENV{THRUST_DEBUG};
$js ||= JSON::XS->new->pretty->canonical;
my $out = "\n" . $msg_cb->() . "\n";
$out .= $js->encode($to_d
my $line_handler; $line_handler = sub {
my ($hdl, $line) = @_;
my $msg = eval { decode_json($line) };
if (defined $msg) {
debug(1, sub { "<<<<<<<<<<<<<<<<< Message from thrust s
Mojo::Collection->new(@{shift()});
}
*c = \&collection;
sub json {
require Mojo::JSON;
Mojo::JSON::encode_json(shift);
}
*j = \&json;
1;
=head1 NAME
Mojo::Autobox::Array - Autobox array meth
x;
# "a"
[qw/a b c/]->collection->first;
# '["x", "y", "z"]'
@array = (qw/x y z/);
@array->json;
=head1 DESCRIPTION
Array methods for L<Mojo::Autobox>. These methods also apply to array refer
Collection>, contructed from the elements of the invocant array.
=head2 json
Serializes the invocant array using L<Mojo::JSON/encode_json> and returns the result.
=head2 j
An alias for L</json>.
a status
$ curl -d '{"text":"hello, world!"}' http://localhost:5000/timelines/home/statuses.json
=back
See L<BusyBird::Manual::Tutorial> for detail.
=head1 DOCUMENTATION
=over
=item L<BusyB
'0.4';
use strict;
use warnings;
use LWP::UserAgent;
use Ceph::RadosGW::Admin::HTTPRequest;
use JSON;
use Moose;
use URI;
use URI::QueryParam;
use Ceph::RadosGW::Admin::User;
use namespace::autoclea
thod, $path, %args) = @_;
my $content = '';
my $query_string = _make_query(%args, format => 'json');
my $request_builder = Ceph::RadosGW::Admin::HTTPRequest->new(
method => $method,
pa
line, $res->content, $req->as_string);
}
if ($res->content) {
my $data = eval {
JSON::decode_json($res->content);
};
if (my $e = $@) {
die "Could not deserialize server response:
ats are YAML, JSON and XML. The format
is determined by the file extension, so use the appropriate one. Note
that XML::Simple is used to parse XML files and JSON::XS is used to parse
JSON files.
=ite
ify this data in a file or with a hash reference.
The currently supported file formats are YAML, JSON and XML. The format is
determined by the file extension, so use the appropriate one. Note the
XML
e =~ /\.json$/i)
? $self->_load_json($file_name)
: ($file_name =~ /\.xml$/i)
? $self->_load_xml($file_name)
: die "Expected '$file_name' to end with .yaml, .json or .xm
ile(shift);
}
sub _load_json {
my $self = shift;
require JSON::XS;
my $json = do { local $/; open my $json, '<', shift; <$json> };
JSON::XS::decode_json($json);
}
sub _load_xml {
BusyBird::Manual::Status - Status object specification
=head1 SYNOPSIS
use JSON;
my $status = decode_json(<<'STATUS');
{
"id": "http://api.example.com/2291",
"create
in JSON format). It should be serializable to
JSON and deserializable from JSON.
=head1 FIELDS
The following fields in a status object is used by BusyBird.
Note that the following list uses JSON f