ecurityCenter::REST;
use warnings;
use strict;
use version;
use Carp ();
use HTTP::Cookies;
use JSON;
use LWP::UserAgent;
use Net::SecurityCenter::Error;
use Net::SecurityCenter::Utils qw(trim dump
else {
$request->header( 'Content-Type', 'application/json' );
if ($params) {
$request->content( encode_json($params) );
}
}
# Reset error
$self->{'
>code();
my $result = {};
my $is_json = ( $response_ctype =~ /application\/json/ );
# Force JSON decode for 403 Forbidden message without JSON Content-Type header
if ( $response_cod
find F<2016-altstetten> and many
others like it. Under F<2016-altstetten> you’d find the F<data.json> and
F<index.html> files (both of which get parsed), and the various subdirectories.
In your F<c
nary read_text);
use Encode qw(decode_utf8 encode_utf8);
use Modern::Perl;
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Util qw(url_unescape);
# galleries
push(@extensions, \&galleries);
o
return 1;
}
if (not -r "$galleries_dir/$dir/data.json") {
result($stream, "40", "This gallery does not contain a data.json file like the one created by sitelen-mute or fgallery");
e warnings;
use feature 'signatures';
no warnings qw(experimental::signatures);
use Carp ();
use JSON ();
our $VERSION = 4.01;
package Net::Google::Analytics::MeasurementProtocol {
sub new ($cla
push @formatted_events, { name => $name, params => $params }
}
my $payload = JSON::encode_json({
client_id => $self->{client_id},
events => \@formatted_events,
});
'Furl') ? undef : (), $payload );
if ($res->is_success) {
return $self->{debug} ? JSON::decode_json($res->decoded_content) : 1;
}
return { __PACKAGE__ => $res->decoded_content };
}
tch::Client::Tiny::Async;
sub trace_cb {
my ($type, $msg) = @_;
printf "%s: %s\n", $type, to_json($msg, {pretty => 0, canonical => 1});
}
my $async = RPC::Switch::Client::Tiny::Async->new(tr
t JSON output.
This routine provides a convenience way to get a data structure from running a
CLI command. It basically just calls the script with `--json` and
`--no-naked-res` then decodes the JSON
result so you get a data structure
directly. Will return error 599 if output is not valid JSON.
Other features might be added in the future, e.g. retry, custom configuration
file, etc.
_
args =>
t => [],
},
},
};
sub call_cli_script {
require IPC::System::Options;
require JSON::MaybeXS;
my %args = @_;
my $script = $args{script};
my $argv = $args{argv} // []
e warnings;
use feature 'signatures';
no warnings qw(experimental::signatures);
use Carp ();
use JSON ();
use HTTP::Tiny;
our $VERSION = '0.0.3';
package Net::NVD {
sub new ($class, %args) {
/json/cves/2.0?' . _build_url_params($self->{ua}, %params));
if ($res->{success}) {
my $json = JSON::decode_json($res->{content});
return $self->{format} eq 'complete'
? $json
: map $_->{cve}, $json->{vulnerabilities}->@*;
}
Carp::carp($res->{headers}{message} // "error querying NVD service ($res->{status})");
return ();
}
sub _build_user_agent($api_key) {
t => R_INT|R_BOOL },
);
my %php_funcs_json = (
json_encode => { ret => R_STR },
json_decode => { ret => R_MIXED },
json_last_error => { ret => R_INT },
json_last_error_msg => { ret => R_STR },
);
\%php_funcs_hash,
libxml => \%php_funcs_libxml,
filter => \%php_funcs_filter,
json => \%php_funcs_json,
spl => \%php_funcs_spl,
session => \%php_funcs_session,
pdo => \%php_f
//coveralls.io';
our $SERVICE_NAME = 'coveralls-perl';
use Devel::Cover::DB;
use HTTP::Tiny;
use JSON::PP;
use YAML;
use Data::Dumper;
sub get_source {
my ($file, $callback) = @_;
my $sourc
}
my $json = {};
$json->{repo_token} = $config->{repo_token} if $config->{repo_token};
$json->{repo_token} = $ENV{COVERALLS_REPO_TOKEN} if $ENV{COVERALLS_REPO_TOKEN};
$json->{flag_nam
e} = $ENV{COVERALLS_FLAG_NAME} if $ENV{COVERALLS_FLAG_NAME};
$json->{parallel} = \1 if $ENV{COVERALLS_PARALLEL};
my $is_travis;
my $endpoint = ($ENV{COVERALLS_ENDPOINT} || $API_ENDPOINT)
l::Releases::MetaCPAN;
use File::pushd qw(pushd);
use File::Temp;
use HTTP::Tinyish;
use JSON::PP qw(decode_json);
use Devel::PatchPerl 0.88;
use Perl::Build::Built;
use Time::Local;
our $CPAN_MIRROR
Perinci::CmdLine::Lite") &&
($args{_func_args}{-cmdline_r}{format} // '') !~ /json/) {
my $data = $args{_data};
for (@$data) {
$
;
use JSON;
use Pod::Usage;
use parent 'App::TenableSC';
use App::TenableSC::Utils qw(:all);
our $VERSION = '0.311';
@App::TenableSC::command_options = (
'output|format|f=s',
'json',
'dumper',
'verbose'
);
sub startup {
my ($self) = @_;
my @output_formats = qw/json table csv tsv yaml dumper/;
if ( $self->options->{'format'} ) {
if ( !grep { $self->
od2usage( -exitstatus => 0, -verbose => 0 );
}
}
$self->options->{'format'} ||= 'json';
foreach (@output_formats) {
$self->options->{'format'} = $_ if ( $self->options->{
l;
use File::Slurper qw(read_binary write_binary);
use List::Util qw(sum);
use Mojo::JSON qw(decode_json encode_json);
use Net::IP qw(:PROC);
use Net::DNS qw(rr);
@known_fingerprints = qw(
sha256$5
$server->{wiki_dir};
return unless -f "$dir/speed-bump.json";
my $bytes = read_binary("$dir/speed-bump.json");
$speed_data = decode_json $bytes;
speed_bump_compute_cidr_blocks() });
# save e
jo::IOLoop->recurring(1800 => sub {
my $bytes = encode_json $speed_data;
my $dir = $server->{wiki_dir};
write_binary("$dir/speed-bump.json", $bytes) });
sub speed_bump_admin {
my $stream = sh
f8 decode_utf8);
use File::Slurper qw(read_binary write_binary read_text);
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Util qw(gzip);
use List::Util qw(first none any);
use URI::Escape;
use
{
my $dir = $server->{wiki_dir};
if (-f "$dir/ijirait.json") {
my $bytes = read_binary("$dir/ijirait.json");
$data = decode_json $bytes;
} else {
init();
} } );
sub init {
my $
k\n");
}
sub save_world {
cleanup();
my $bytes = encode_json $data;
my $dir = $server->{wiki_dir};
write_binary("$dir/ijirait.json", $bytes);
}
sub cleanup() {
my $now = time;
my %people
idators
>;
use JSON;
use Types::Standard qw< Enum HashRef InstanceOf Maybe Str >;
our $VERSION = '0.001';
our $DEBUG = 0;
=head1 NAME
MooX::Role::REST - Simple HTTP client for JSON-REST as a Moo::
s::CompiledValidators'));
=head1 DESCRIPTION
Helper role to implement a simple REST client with JSON.
=head2 call
Mandatory method that implements the actual HTTP stuff.
=cut
sub call {
my $
ndpoint->query($params) if $params;
}
else {
@body = $cdata ? { content => encode_json($cdata) } : ();
}
print STDERR ">>>$hmethod($endpoint)>>>@body<<<\n"
if $DEBUG;
PSIS
package My::Client;
use Moo;
with qw< MooX::Role::HTTP::Tiny >;
use JSON qw< encode_json >;
# implent a call to the API of a webservice
sub call {
my $self = shi
i->path . $path : $path)
if $path;
my @params = $args ? ({ content => encode_json($args) }) : ();
if (uc($method) eq 'GET') {
my $query = $self->www_form_urlen
webservice that uses the HTTP(S)
transport protocol.
Some best known protocols are I<XMLRPC>, I<JSONRPC> and I<REST>, and can be
implemented through the required C<call()> method.
=cut
sub _build_
use File::Basename qw{basename};
use Getopt::Std qw{getopts};
use Tie::IxHash qw{};
use JSON::XS qw{encode_json};
use Time::HiRes qw{};
use WebService::Whistle::Pet::Tracker::API qw{};
require Net::M
'} );
$count++ if $mqtt->publish("$topic/last_location" => encode_json(\%location) );
$count++ if $mqtt->publish("$topic/device/battery_level" => $pet->
use Cwd ();
use ExtUtils::Packlist;
use File::Basename ();
use File::Find ();
use File::Spec;
use JSON ();
use Module::Metadata;
use constant DEBUG => $ENV{PERL_DISTRIBUTION_METADATA_DEBUG};
my $SEP
$find_version = $module->{version};
}
my ($meta_directory, $install_json, $install_json_hash, $mymeta_json) = $class->_find_meta(
$main_module, $find_module, $find_version,
$meta_directory;
$self->{install_json} = $install_json;
$self->{install_json_hash} = $install_json_hash;
$self->{mymeta_json} = $mymeta_json;
$self;
}
sub _guess_main_modul
/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
Pet::Tracker::API->new(email=>$email, password=>$password);
my $json = JSON::XS->new->pretty;
my $pets = $ws->pets;
print $json->encode($pets);
__END__
=head1 NAME
perl-WebService-Whistle-
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 {
stribution::Metadata->new >> scans C<@INC> directories,
parses packlist files, and parses install.json files many times.
Distribution::Metadata::Factory caches such results,
so you can create Distrib