printf '0.4.%d', q$Rev: 1 $ =~ /\d+/gmx );
use Getopt::Long;
use HTTP::Tiny;
use JSON::PP qw( decode_json encode_json );
my $URI_TEMPLATE = 'http://localhost:5000/coverage/report/%s';
# Private sub
Content-Type' => 'application/json' } );
my $uri = sprintf $config->{option}->{uri_template}, lc $dist;
my $resp = $http->post( $uri, { content => encode_json $report } );
if ($resp->
{success}) {
my $content = decode_json $resp->{content};
print $content->{message}."\n";
}
else {
warn 'Coverage upload status '.$resp->{status}.': '.$resp->{reason}."\n";
l::Client::Object::ImageIndicator;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Date::
# return perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
f
deserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
arget/swagger-codegen-cli.jar generate \
-i [URL or file path to JSON swagger API spec] \
-l perl \
-c /path/to/config/file.json \
-o /path/to/output/folder
Bang, all done. Run the C<autodoc>
} ## end sub normalize_record
sub parse_request {
my ($self, $req) = @_;
my $data = $req->json;
return unless $data->{object} eq 'page';
local $Data::Dumper::Indent = 1;
my @updates;
ETHODS = (
'JSON::PP' => sub { $_[0] ? JSON::PP::true() : JSON::PP::false() },
'JSON::XS' => sub { $_[0] ? JSON::XS::true() : JSON::XS::false()
verter;
my $converter = Boolean::Converter->new();
my $booelan = $converter->convert_to(JSON::PP::true, 'Data::MessagePack');
# => Data::MessagePack::true
=head1 DESCRIPTION
Boolean::C
dynamic prereqs to the included modules list (if we can)
my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
if ($source and $has_cpan_meta) {
if (my $meta = eval { CPAN::Meta->load_file
s the DigitalOcean RESTful API (v2)
use Moo;
use Types::Standard qw/Str/;
use LWP::UserAgent;
use JSON ();
use DateTime;
use utf8;
with
'WebService::DigitalOcean::Role::UserAgent',
'WebServic
package Net::Marathon::Group;
use strict;
use warnings;
use parent 'Net::Marathon::Remote';
use JSON::XS;
sub new {
my ($class, $conf, $parent) = @_;
my $self = bless {};
$conf = {} unle
/v2/groups', $self->get_updateable_values);
if ( $response ) {
$self->version( decode_json($response)->{version} );
return $self;
}
return undef;
}
sub update {
my ($
f->id . $self->_uri_args($args), $payload);
if ( $response ) {
$self->version( decode_json($response)->{version} );
return $self;
}
return undef;
}
sub delete {
my ($
',
%args,
ua_args => [
$self->_url,
{Accept => 'application/json'},
json => $message,
($args{callback} ? $args{callback} : ()),
],
);
} ## end
package Net::Marathon;
use 5.006;
use strict;
use warnings;
use LWP::UserAgent;
use JSON::XS;
use Net::Marathon::App;
use Net::Marathon::Group;
use Net::Marathon::Events;
use Net::Marathon::Deploymen
tp://mesosphere.github.io/marathon/docs/rest-api.html), so it can be used without having to write JSON by hand.
For the most common tasks, there is a helper method in the main module. Some additional
( $status ) {
$status = '?status='.$status;
}
my $task_obj = $self->_get_obj_from_json('/v2/tasks'.$status);
my $task_arrayref = ( defined $task_obj && exists $task_obj->{tasks} &&
t;
# ABSTRACT: User Agent Role for DigitalOcean WebService
use Moo::Role;
use LWP::UserAgent;
use JSON ();
use DateTime;
use Types::Standard qw/is_HashRef/;
use utf8;
our $VERSION = '0.026'; # VERSIO
= (
'Authorization' => 'Bearer ' . $self->token,
'Content-Type' => 'application/json; charset=utf-8',
);
my $ua = LWP::UserAgent->new(
agent => 'WebService
) = @_;
my $full_url = $self->api_base_url . $uri;
my $encoded_data = $data ? JSON::encode_json($data) : undef;
my $headers = undef;
return HTTP::Request->new( $method, $fu
::WebMaster::VERSION = '0.400115';
use strict;
use v5.10;
use Moo::Role;
use LWP::UserAgent;
use JSON;
use Data::Dumper;
use File::Path qw(make_path remove_tree);
use BalanceOfPower::Utils qw(prev_t
onse->decoded_content;
}
else
{
my $json = JSON->new->allow_nonref;
return $json->decode( $response->decoded_content );
}
}
else {
AccessLog::Structured::ZeroMQ is a
L<Plack::Middleware|Plack::Middleware> which sends structured, JSON-encoded log
messages into a ZeroMQ message queue. It is a subclass of
L<Plack::Middleware::Access
2::Serializer::JSONMaybeXS;
use Moo;
use JSON::MaybeXS ();
our $VERSION = '0.003';
with 'Dancer2::Core::Role::Serializer';
has '+content_type' => ( default => sub {'application/json;charset=UTF-8'
} );
sub BUILD {
warnings::warnif('deprecated',
'Dancer2::Serializer::JSONMaybeXS is deprecated and should no longer be used');
}
sub serialize {
my ($self, $entity, $options) = @_;
my $confi
tions->{utf8};
JSON::MaybeXS->new($options)->encode($entity);
}
sub deserialize {
my ($self, $entity, $options) = @_;
$options->{utf8} = 1 if !defined $options->{utf8};
JSON::MaybeXS->new($op
IPTION
Jq is a data language for querying and manipulating JSON data. It takes JSON
as input; queries and manipulates; and then prints JSON as output.
Jq.pm is a Perl module binding to Jq. It's inpu
ts and outputs are Perl data
abjects that can be represented as JSON.
=head1 STATUS
The current version of Jq uses IPC::Run to invoke your local C<jq> binary.
This is an API compatible workaround un
e JSON;
use Exporter 'import';
our @EXPORT = qw(jq);
sub jq {
my ($filter, @data) = @_;
my @jq = ('jq', "$filter");
my ($in, $out, $err);
for my $value (@data) {
$in .= JSON:
:encode_json($value) . "\n";
}
run \@jq, \$in, \$out, \$err, timeout(10)
or die "jq: $?, $err";
my $result = JSON::decode_json("[$out]");
return wantarray ? @$result : $result
ld').", Child_id=".$self->param('child_id'))
# if ($self->param('child'));
$self->render( json => {'<%=$class %>-<%=$action%>'=>'Stub!',id=>$self->param('id'),child_id=>$self->param('child_id'
nghita/Mobile-Detect/blob/master/Mobile_Detect.json
#
use 5.006;
use strict;
no strict "subs";
use warnings FATAL => 'all';
no warnings qw/misc/;
use JSON;
use LWP::Protocol::https;
use LWP::UserAgent
;
use constant JSON_REMOTE_FILE => 'https://raw.githubusercontent.com/serbanghita/Mobile-Detect/master/Mobile_Detect.json';
use constant JSON_LOCAL_FILE => '/var/tmp/Mobile_Detect.json';
use constan
detect_mobile_ua);
sub new {
my($class, %args) = @_;
my $self = bless({}, $class);
my $json = JSON->new();
my $filestamp = 0;
my $filesize = 0;
my %hashfile;
my $hash;
if (-e HASH_LOC
_limit_remaining;
=head1 DESCRIPTION
Often, the result of a Twitter API call, inflated from the JSON body of the
HTTP response does not contain all the information you need. Twitter includes
meta da
d;
use Net::Lumberjack::Frame::Ack;
use Net::Lumberjack::Frame::Data;
use Net::Lumberjack::Frame::JSON;
has 'version' => ( is => 'rw', isa => 'Int', default => 1 );
has 'type' => ( is => 'rw', isa =>
YPES = (
'A' => 'Ack',
'W' => 'WindowSize',
'C' => 'Compressed',
'D' => 'Data',
'J' => 'JSON',
);
sub new_from_fh {
my ( $class, $fh ) = ( shift, shift );
my ( $version, $type );
# EOF