oad '""' => 'to_string', fallback => 1;
# ABSTRACT: an individual demon
use JSON::PP;
my %DEMONS_BY_NAME = %{ decode_json(do { local $/; <DATA> }) };
for my $name (keys %DEMONS_BY_NAME) {
$DEMO
package API::ParallelsWPB::Response;
use strict;
use warnings;
use JSON::XS qw/decode_json/;
# ABSTRACT: processing of API responses
our $VERSION = '0.03'; # VERSION
our $AUTHORITY = 'cpan:IMAGO'; #
line;
my ( $json_content, $response, $error );
if ( $success ) {
$json_content = $res->content;
$response = decode_json( $json_content )->{response} if $json_content;
}
else {
my $error_json = $res->content;
eval { $error = decode_json( $error_json )->{error}->{message}; 1; }
or do { $error = $error_json };
}
return bless(
e HTTP endpoints and complex plugins.
The simple HTTP plugins just receive the whole queue in as JSON encoded array.
Those only need to subclass App::Standby::Service::HTTP and provide an implementat
ervice.
Choose class HTTP for a simple endpoint which just gets the whole ordered user list as a JSON
string. Chosse MS for a Monitoring::Spooler endpoint and Pingdom if you have an Pingdom account.
octurne::Demons::FusionChart::VERSION = '0.02';
use strict;
use warnings;
use JSON::PP;
my %FUSION_DATA = %{ decode_json(do { local $/; <DATA> }) };
my %TYPES = %{ $FUSION_DATA{normal_fusions} };
my
:JSON 'std_parse';
# Optionally specify a single json_corpus file to test.
# If no argument, then all inline & corpus tests run.
my $file = shift;
# Inline tests.
my @cfg = $file ? () : (
[json_
space => ' '],
[json_escape_seq => '\\"'],
[json_null_literal => 'null'],
[json_bool_literal => 'true'],
[json_bool_literal => 'false'],
[json_string_char => 'chars'],
[json_string => qq|"This. Is\na string?\r\f"|],
[json_member_list => '"nada":null'],
[json_element_list => 'true, false, null, 1, 2'],
[json_array => '[1, 2]'],
[json_m
re>.
The JBD namespace also contains lexing, parsing and grammar tools.
For JSON tokenizing and parsing, see L<JBD::JSON>.
For general parsing tools, see L<JBD::Parser>.
=head1 AUTHOR
Joel Dalley
package API::ParallelsWPB;
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
use JSON::XS;
use Carp;
use API::ParallelsWPB::Response;
use base qw/ API::ParallelsWPB::Requests /;
# A
confess "parameter post_data must be hashref or arrayref!"
}
$post_data = $self->_json->encode($data->{post_data});
}
$post_data ||= '{}';
my $response = $self->_send_requ
eq 'POST' || $data->{req_type} eq 'PUT' ) {
$req->header( 'content-type' => 'application/json' );
$req->content( $post_data );
}
$req->authorization_basic( $self->{username},
use LWP::UserAgent;
use English '-no_match_vars';
use HTTP::Request::Common qw(POST);
use JSON qw(decode_json);
use File::Temp;
use File::HomeDir;
use Cwd;
use Scope::Guard;
use Ukigumo::Constants;
to @{[ $self->server_url ]}/api/v1/report/add:\n" . $res->as_string;
my $dat = eval { decode_json($res->decoded_content) } || $res->decoded_content . " : $@";
$self->logger->infof("report url
package Net::Docker;
use strict;
use 5.010;
our $VERSION = '0.002005';
use Moo;
use JSON;
use URI;
use URI::QueryParam;
use LWP::UserAgent;
use Carp;
use AnyEvent;
use AnyEvent::Socket 'tcp_connect';
tent_type eq 'application/json') {
return decode_json($res->decoded_content);
}
elsif ($res->content_type eq 'text/plain') {
return eval { decode_json($res->decoded_content) };
my ($self, $res) = @_;
if ($res->content_type eq 'application/json') {
my $json = JSON::XS->new;
return $json->incr_parse($res->decoded_content);
}
my $message = $res->d
a and Kanbanize sync tool
use Data::Dumper;
use Net::Bugzilla::Kanbanize;
use LWP::Simple;
use JSON;
use LWP::UserAgent;
use File::HomeDir;
use HTTP::Request;
use URI::Escape;
use List::MoreUtils
res->is_success ) {
die Dumper($res); #$res->status_line;
}
my $data = decode_json( $res->decoded_content );
my %bugs;
foreach my $bug ( @{ $data->{bugs} } ) {
$b
res->is_success ) {
die Dumper($res); #$res->status_line;
}
my $data = decode_json( $res->decoded_content );
my @found_bugs = @{ $data->{bugs} };
foreach my $bug ( sort @
strict;
use warnings;
use Async::Chain;
use AnyEvent;
use AnyEvent::Loop;
use AnyEvent::HTTP;
use JSON;
use Data::Dumper;
my %state;
chain
sub {
my $next = shift;
http_get(
'http://api.metac
=1',
$next
);
},
sub {
my $next = shift;
my ($body, $headers) = @_;
%state = %{ from_json($body)->{hits}->{hits}->[0]->{fields} };
http_get "http://api.metacpan.org/v0/author/$state{aut
me", $next;
},
sub {
my $next = shift;
my ($body, $headers) = @_;
$state{realname} = from_json($body)->{name};
printf "%s (aka %s) release %s at %s\n", $state{realname}, $state{author}, $sta
8;
use DBIx::Sunny;
use Time::Piece;
use Digest::MD5 qw/md5_hex/;
use List::Util;
use Encode;
use JSON;
use Log::Minimal;
use List::MoreUtils qw/uniq/;
use List::Util qw/first/;
sub new {
my $cla
Y/%m/%d %T');
$row->{md5} = md5_hex( Encode::encode_utf8($row->{id}) );
my $ref = decode_json($row->{meta}||'{}');
$ref->{adjust} = '*' if ! exists $ref->{adjust};
$ref->{adjustval} =
ame description sort gmode color type stype llimit ulimit sllimit sulimit/;
my $meta = encode_json($args);
my $dbh = $self->dbh;
$dbh->query(
'UPDATE graphs SET service_name=?, sec
ckage Word::Segmenter::Chinese::Lite::Dict;
use 5.008008;
use strict;
use warnings;
use JSON::XS qw(decode_json);
use Word::Segmenter::Chinese::Lite::Dict::Default;
require Exporter;
our @ISA =
(wscl_get_dict_default);
sub wscl_get_dict_default {
my $dict_default_hashref =
decode_json($Word::Segmenter::Chinese::Lite::Dict::Default::DICT_DEFAULT);
return %$dict_default_hashref;
package GrowthForecast::Web;
use strict;
use warnings;
use utf8;
use Kossy 0.10;
use JSON;
use Time::Piece;
use GrowthForecast::Data;
use GrowthForecast::RRD;
use Log::Minimal;
use Class::Accessor::L
ta_dir float_number rrdcached disable_subtract/] );
use URI::Escape qw/uri_escape_utf8/;
my $_JSON = JSON->new()->allow_blessed(1)->convert_blessed(1)->ascii(1);
sub data {
my $self = shift;
ta->remove($c->stash->{graph}->{id});
$self->rrd->remove($c->stash->{graph});
$c->render_json({
error => 0,
location => "".$c->req->uri_for(sprintf('/list/%s/%s', map { uri_es
package WebService::SwigClient;
use Moo;
our $VERSION = '0.001';
use JSON::XS qw(encode_json);
use WWW::Curl::Easy;
has api_key => ( required => 0, is => 'rw' );
has service_url => ( required =
->setopt(CURLOPT_POST, 1);
$render_curl->setopt(CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
return $render_curl;
});
has error_handler => ( is => 'rw' );
{
my $singleton;
sub in
ncode_json($data));
}
sub create_template {
my ($self, $filename, $data) = @_;
my $url = join('/',($self->service_url, $self->api_key, $filename));
return $self->post($url, encode_json($data
data --items Q42,P19 to JSON --pretty 1
echo Q42 | catmandu convert Wikidata to JSON --pretty 1
catmandu convert Wikidata --site enwiki --title "Emma Goldman" to JSON --pretty 1
catmandu
convert Wkidata --title dewiki:Metadaten to JSON --pretty 1
catmandu convert Wikidata --title "Emma Goldman" \
--fix "wd_language('en')" to JSON --pretty 1
=head1 DESCRIPTION
B<Catmandu
kigumo::Client::Notify::GitHubStatuses;
use strict;
use warnings;
use utf8;
use Mouse;
use JSON qw/encode_json/;
use Ukigumo::Constants;
has 'api_endpoint' => (
is => 'ro',
isa =>
state || !$description) {
# Nothing to do
return;
}
my $payload = encode_json({
state => $state,
target_url => $report_url,
description => $desc
'0.06'; #VERSION
use Catmandu::Sane;
use Moo;
use URI::Template;
extends 'Catmandu::Importer::getJSON';
has api => (
is => 'ro',
default => sub { 'http://www.wikidata.org/w/api.php' }
);
URI::Template->new(
$_[0]->api
. '?action=wbgetentities&format=json{&ids}{&sites}{&titles}'
);
}
);
has '+from' => (
is => 'ro',
lazy => 1,
options (C<ids>, C<site>, and/pr C<title>) or as line-separated
input values. By default, the raw JSON structure of each Wikidata entity is
returned one by one. Entities not found are returned with th
st);
use strict;
use constant URL => 'https://localbitcoins.com/bitcoincharts/%s/trades.json';
use constant ATTRIBUTES => qw(since);
use constant REQUEST_TYPE => 'GET';
use constant IS_PRI