0.100;
use v5.16;
use warnings;
use Carp ();
use HTTP::Tiny 0.055;
use IO::Socket::SSL 1.42;
use JSON::PP ();
sub new {
my ($class, %args) = @_;
my $http = $args{http} || do {
my $ag
om,
};
my $body = JSON::PP::encode_json $payload;
my $res = $self->{http}->post($self->{url}, {
'content-type' => 'application/json',
'content-length' =
{content}";
}
my $json = JSON::PP::decode_json $res->{content};
my $total = $json->{hits}{total};
push @hit, map $_->{_source}, @{$json->{hits}{hits}};
last if
artup.2016-01-07T15-05-13.json |
| LogAny::Startup | 1 | 2016-01-07T15:10:51 | Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz | LogAny-Startup.2016-01-07T15-10-51.json |
| LogAny::Startup | 1
016-01-10T22:27:48 | Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz | LogAny-Startup.2016-01-10T22-27-48.json |
+-----------------+----------------+---------------------+------------------------------------
artup.2016-01-07T15-05-13.json |
| LogAny::Startup | 1 | 2016-01-07T15:10:51 | Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz | LogAny-Startup.2016-01-07T15-10-51.json |
| LogAny::Startup | 1
rtRow::VERSION = '0.008';
# ABSTRACT: Connect and get data from SmartRow API
use HTTP::Tiny;
use JSON::MaybeXS;
use Moo;
use namespace::clean;
has username => ( is => 'ro', required => 0 );
has pas
esponse->{success} ) {
return 'Response error';
}
my $json = decode_json $response->{content};
return $json;
}
# https://smartrow.fit/api/account
sub get_profile {
my $self
esponse->{success} ) {
return 'Response error';
}
my $json = decode_json $response->{content};
return $json->[0];
}
# https://smartrow.fit/api/public-game
sub get_workouts {
package WebService::Whistle::Pet::Tracker::API;
use strict;
use warnings;
use JSON::XS qw{};
use HTTP::Tiny qw{};
our $VERSION = '0.03';
our $PACKAGE = __PACKAGE__;
our $API_URL = 'https://app.whistl
$pet (@$pets) {
print JSON::XS->new->pretty->encode($pet);
}
=head1 DESCRIPTION
Perl interface to access the Whistle Pet Tracker Web Service. All methods return JSON payloads that are convert
n array instead of a hash like other calls
=head1 METHODS (API)
=head2 api
Returns the decoded JSON data from the given web service end point
my $data = $ws->api('/end_point');
=cut
sub api {
/perl
use strict;
use warnings;
use File::Basename qw{basename};
use Getopt::Std qw{getopts};
use JSON::XS qw{};
use WebService::Whistle::Pet::Tracker::API qw{};
my $basename = basename($0);
my $synt
new(email=>$email, password=>$password);
my $json = JSON::XS->new->pretty;
foreach my $argv (@ARGV) {
my $device = $ws->device($argv);
print $json->encode($device);
}
__END__
=head1 NAME
p
::Usage ();
our $IGNORE_FILE = [
qr/\.pod$/,
qr/\.packlist$/,
qr/MYMETA\.json$/,
qr/install\.json$/,
];
sub new {
my ($class, @argv) = @_;
bless { @argv }, $class;
}
sub par
=> [qw(bake_cookie crush_cookie)],
'Cpanel::JSON::XS' => [qw(encode_json decode_json to_json from_json)],
'Crypt::RC4' => [qw(RC4)],
'JSON' => [qw(from_json to_json jsonToObj objToJson encode_json decode_json)],
'JSON::MaybeXS' => [qw(encode_json decode_json JSON)],
'JSON::P
> [qw(encode_json decode_json from_json to_json)],
'JSON::Types' => [qw(number string bool)],
'JSON::XS' => [qw(encode_json decode_json)],
:reporter');
our $VERSION = '0.11';
use Carp;
use File::Path qw( make_path );
use File::Spec;
use JSON;
use URI;
use CPAN::DistnameInfo;
#use Data::Dump qw( dd pp );
=head1 NAME
CPAN::cpanminus::rep
poses and transmits a report to L<CPANtesters.org>, this library's
C<run()> method generates a F<.json> report file for each distribution
analyzed and retains that on disk for subsequent processing or
'json'))
: File::Spec->catfile($tdir, join('.' => $dist, 'log', 'json'));
open my $OUT, '>', $report or croak "Unable to open $report for writing";
say $OUT encode_json(
=head1 SYNOPSIS
use Dancer::RPCPlugin::DispatchItem;
use Dancer::Plugin::RPC::JSONRPC;
jsonrpc '/json' => {
publish => sub {
return {
'system.ping' =>
:Plugin::RPC::JSONRPC;
use v5.10;
use Dancer ':syntax';
use Dancer::Plugin;
use Scalar::Util 'blessed';
use Time::HiRes 'time';
our $VERSION = '1.09';
use constant PLUGIN_NAME => 'jsonrpc';
use Dan
debug("Starting jsonrpc-handler build: ", $lister);
my $handle_call = sub {
my ($ct) = (split /;\s*/, request->content_type, 2);
if ($ct ne 'application/json') {
pa
my @requests = unjson(request->body);
if (!exists($requests[0]->{jsonrpc}) or $requests[0]->{jsonrpc} ne "2.0") {
pass();
}
debug("[handle_jsonrpc_request] Proce
ub {
my ($ct) = (split /;\s*/, request->content_type, 2);
if ($ct ne 'application/json') {
pass();
}
debug("[handle_restrpc_request] Processing: ", request-
pass();
}
content_type 'application/json';
my $response;
my $method_args = request->body
? from_json(request->body)
: undef;
debug("[
nse } if !ref($response);
my $jsonise_options = {canonical => 1};
if (config->{encoding} && config->{encoding} =~ m{^utf-?8$}i) {
$jsonise_options->{utf8} = 1;
}
0'; # VERSION
1;
# ABSTRACT: Command-line tool for JSON::Path
__END__
=pod
=encoding UTF-8
=head1 NAME
App::jpath - Command-line tool for JSON::Path
=head1 VERSION
This document describes vers
configming to spec: $@"
=item B<application/json>
If the B<body> is valid JSONRPC (ie. is has a I<'jsonrpc': '2.0'> field/value),
the response is a JSONRPC-error:
code => -32601
message =>
"Method '%s' not found"
If the B<body> is I<not> valid JSONRPC, the response is a generic json struct:
'error': {
'code': -32601,
'message': "Method '$request->path' not found"
elsif ( $content_type eq 'application/json' ) {
content_type('application/json');
my $request = request->body
? from_json(request->body, {allow_nonref => 1})
ou use requires)
will have to state a minimal supported perl version that ends up in
L<META.json|./META.json> and L<META.yml|./META.yml>
Do not guess. It is easy to check with
=over
=item - L<Test:
<JSON::PP|https://metacpan.org/pod/JSON::PP>
=item - L<Parse::CPAN::Meta|https://metacpan.org/pod/Parse::CPAN::Meta>
=item - L<Test::CPAN::Meta::JSON|https://metacpan.org/pod/Test::CPAN::Meta::JSON>
urces>,
like your public repository URL and the preferred way to communicate in your L<META.json|./META.json>:
"resources" : {
"x_IRC" : "irc://irc.perl.org/#toolchain",
"rep
0";
BEGIN { $V::NO_EXIT = $V::NO_EXIT = 1; }
require V;
my %m;
open my $fh, "<", "META.json" or die "META.json: $!\n";
while (<$fh>) {
my ($m, $v) = m/^\s+ "(\S+)" \s+ : \s+ "([0-9.]+)" /x or ne
package Museum::MetropolitanMuseumArt;
use 5.34.0;
use strictures 2;
use JSON::MaybeXS;
use LWP::UserAgent;
use Moo;
use URI::QueryParam;
use namespace::clean;
=head1 NAME
Museum::MetropolitanMus
my $req = HTTP::Request->new(
GET => $url,
[
'Accept' => 'application/json; charset=UTF-8',
]
);
my $res = $ua->request($req);
if ( !$res->is_success
olitan Museum 'objects' API: " . $res->status_line . "\n";
}
my $json = JSON::MaybeXS->new();
my $content = $json->decode( $res->decoded_content );
return $content->{objectIDs};
}
=h
odule and print warnings if conflicts are detected.
Finally, it adds the conflicts to the F<META.json> and/or F<META.yml> files
under the "x_breaks" key.
=for Pod::Coverage gather_files
metadata
cpanfile}) {
if ($self->{json}) {
# TODO: feature support (how should we express it?)
eval { require JSON::PP } or die "requires JSON::PP";
print JSON::PP->new->pretty(1)->canoni
CT: Update a GitHub repo's info on release
use strict;
use warnings;
our $VERSION = '0.49';
use JSON::MaybeXS;
use Moose;
use List::Util 'first';
extends 'Dist::Zilla::Plugin::GitHub';
with 'Dist:
CH $url");
my $response = HTTP::Tiny->new->request('PATCH', $url, {
content => encode_json($params),
headers => $self->_auth_headers,
});
my $repo = $self->_check_response
in::GitHub::Meta;
# ABSTRACT: Add a GitHub repo's info to META.{yml,json}
use strict;
use warnings;
our $VERSION = '0.49';
use JSON::MaybeXS;
use Moose;
extends 'Dist::Zilla::Plugin::GitHub';
with
lla plugin adds some information about the distribution's GitHub
#pod repository to the META.{yml,json} files, using the official L<CPAN::Meta>
#pod specification.
#pod
#pod Note that, to work properl
->log("Using offline repository information") if $offline;
if (!$offline && $repo->{fork} == JSON->true() && $self->fork == 1) {
my $parent = $repo->{parent}{full_name};
my $url