::Config;
use Method::Signatures;
use Sys::Hostname;
use experimental 'say';
use Config::JSON; # libconfig-json-perl
use File::Path qw(make_path);
use Carp 'croak';
use App::EventStreamr::Devices;
use
$self->devices_util->all();
}
method _build_config_file() {
return $self->config_path."/config.json";
}
method _build_nickname() {
return hostname || "default_name";
}
method _build_macaddress(
fig() {
# Config JSON barfs if you try to load a config that doesn't exist,
# this will load one or attempt to create it.
if ( -e $self->config_file ) {
return Config::JSON->new($self->confi
package App::EventStreamr::Status;
use Method::Signatures;
use JSON;
use Scalar::Util::Reftype;
use Moo;
use namespace::clean;
# ABSTRACT: A status object
our $VERSION = '0.5'; # VERSION: Generated
fig->nickname;
my $json = to_json($status);
my %post_data = (
content => $json,
'content-type' => 'application/json',
'content-length' => length($json),
);
my $post
;
%post_data = (
content => to_json($data),
headers => {
'station-mgr' => 1,
'Content-Type' => 'application/json',
}
);
$post = $self->c
kage App::EventStreamr::Roles::ConfigAPI;
use v5.010;
use strict;
use warnings;
use Config::JSON;
use JSON;
use Method::Signatures 20140224; # libmethod-signatures-perl
use HTTP::Tiny '0.053'; # libh
nfig() {
return $self->config_path."/controller.json";
}
method _build_controller() {
if ( -e $self->controller_config ) {
return Config::JSON->new($self->controller_config)->config->{control
== 201) {
# Status Post Data
my $json = to_json($self->_post_data());
$self->debug($json);
my %post_data = (
content => $json,
headers => {
'stat
File::pushd qw/tempd/;
use Path::Class;
use Pod::Strip;
use Archive::Extract;
use HTTP::Tiny;
use JSON;
use namespace::autoclean;
#-------------------------------------------------------------------
) = @_;
my $mod = $self->source_module;
my $uri = $self->_cpanidx . join( "/", qw/cpanidx json mod/, $mod );
my $response = HTTP::Tiny->new->get( "$uri", { headers => { accept => '*' }, }
$mod via $uri: $response->{content}\n"
unless $response->{success};
my $meta = decode_json( $response->{content} )->[0];
return $meta->{dist_file};
}
has _short_distfile => (
is
the bottom for documentation
package Net::Wigle;
use strict;
use warnings;
use Data::Dumper;
use JSON;
use LWP::UserAgent;
use Params::Validate qw(:all);
use 5.010000;
require Exporter;
our @ISA =
ur $VERSION = '0.07';
our $url_query_base = 'https://wigle.net/api/v1/jsonSearch';
our $url_login = 'https://wigle.net/api/v1/jsonUser';
sub new {
my $proto = shift;
my $class = ref $proto || $pr
# purpose : used to return a parsed/scraped html table
# now it just returns the parsed json
sub query {
my $self = shift;
my %args = validate @_, {
user => {
type => SCALAR,
easily be
exported for use in a browser-facing web application:
use JSON qw(encode_json);
my $patterns = encode_json($RE{VATIN});
=head1 CAVEAT
In keeping with the standard set by the core
1;
use strict;
use warnings;
use base qw(Google::BigQuery);
use HTTP::Request;
use JSON qw(decode_json encode_json);
use URI::Escape;
sub new {
my ($class, %args) = @_;
my $self = $class->SUPE
:POST|PUT|PATCH)$/) {
$request->header('Content-Type' => 'application/json');
$request->content(encode_json($args{content}));
}
} else {
my $upload_path = $rest_descrip
d_part(
HTTP::Message->new(
['Content-Type' => 'application/json; charset=UTF-8'],
encode_json($args{content})
)
);
my $data;
open my $in, "<", $
ION = "1.02";
use Class::Load qw(load_class);
use Crypt::OpenSSL::PKCS12;
use JSON qw(decode_json encode_json);
use JSON::WebToken;
use LWP::UserAgent;
sub create {
my (%args) = @_;
my $version
>{private_key_file} =~ /\.json$/) {
open my $in, "<", $self->{private_key_file} or die "can't open $self->{private_key_file} : $!";
my $private_key_json = decode_json(join('', <$in>));
clo
se $in;
$self->{private_key} = $private_key_json->{private_key};
} elsif ($self->{private_key_file} =~ /\.p12$/) {
my $password = "notasecret";
my $pkcs12 = Crypt::OpenSSL::PKCS12->new_f
;
use 5.006;
use strict;
use warnings FATAL => 'all';
use Carp qw( croak );
use Data::UUID;
use JSON::Any;
use LWP::UserAgent;
use URI;
our $VALID_NAME_RE = qr/^[a-z0-9][a-z0-9\-_ ]*$/;
=head1 NAM
host => 'http://localhost:5000',
ua => LWP::UserAgent->new,
json => JSON::Any->new,
client_id => Data::UUID->new->create_str,
%args,
};
ble
my $json = ( $resp->is_success )
? $resp->content
: '{"status": "failed", "response": "http error: sixpack is unreachable"}';
return $self->{json}->jsonToObj( $json );
Bin);
use lib "$Bin/../lib";
use Proc::Daemon; # libproc-daemon-perl
use JSON; # libjson-perl
use Config::JSON; # libconfig-json-perl
use HTTP::Tiny; # libhttp-tiny-perl
use Log::Log4perl; # liblog-lo
/settings.json") {
$localconfig = Config::JSON->new("$Bin/../settings.json");
$localconfig = $localconfig->{config};
} else {
$localconfig = Config::JSON->create("$Bin/../settings.json");
$loc
nfig;
if (-e "$Bin/../station.json") {
$stationconfig = Config::JSON->new("$Bin/../station.json");
} else {
$stationconfig = Config::JSON->create("$Bin/../station.json");
$stationconfig->{config
tests to C<$dir> for C<$distname> C<$version> using C<$mech>
=head2 C<meta ()>
Reads the MYMETA.json file to discover details about the current project.
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND
#!/usr/bin/perl
package MooseX::Role::JSONObject::Util;
use v5.012;
use strict;
use warnings;
use version; our $VERSION = version->declare("v0.1.0");
use List::Util qw/pairfirst/;
use Method::Sign
tribute $attr)
{
if (!$attr->has_type_constraint) {
if (!defined $val) {
die "MooseX::Role::JSONObject::SKIP\n";
} elsif (ref $val eq 'ARRAY') {
return ('array', '*');
} elsif (ref $val e
, '*');
}
return ['*'];
}
if (!defined $val && !$attr->is_required) {
die "MooseX::Role::JSONObject::SKIP\n";
}
my $type = $attr->type_constraint;
my @res;
again:
my @handlers = (
'Obje
erAgent;
use JSON;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(new trigger resolve);
use constant SERVICE_URL => "https://events.pagerduty.com/generic/2010-04-15/create_event.json";
use consta
undef;
$data = eval { JSON::encode_json($request_body); };
if ($data) {
$return_body = eval { $self->{user_agent}->post($self->{url}, Content_Type => 'application/json', Content => $data); };
if (defined $return_body) {
my $result = JSON::decode_json($return_body->decoded_content);
if (defined $result && ref $result eq 'HASH') {
if ($@) {
if (defined $result->{errors} &&
my $json = $c->stash('json');
unless ( defined $json->{data} ) {
$json->{data} = {};
}
unless ( defined $c->match->stack->[0]){
$json->{messa
ash( 'json' => $json );
}
}
);
}
$app->helper( data => sub{
my $self = shift;
my %data = ref $_[0] ? %{ $_[0] } : @_;
my $json = $self->stash('json');
$json = {
data => {}, message => [] } unless defined $json;
@{ $json->{ data } }{ keys %data } = values %data;
$self->stash( json => $json );
return $self;
});
$app->helper( message => sub {
gure out the end of the file
debug "File End: $file_end";
close($IN);
# Return JSON
to_json( { new_curr_pos => $file_end,
interval => $conf->{interval},
MooseX::Role::JSONObject;
use v5.012;
use strict;
use warnings;
use version; our $VERSION = version->declare("v0.1.0");
use Moose::Role;
use Method::Signatures;
use MooseX::Role::JSONObject::Util;
method to_json()
{
return MooseX::Role::JSONObject::Util::meta_to_json(
$self, $self->meta);
}
method from_json($class:, HashRef $data)
{
my $cls = ref $class || $class;
my $meta = Class::M
return MooseX::Role::JSONObject::Util::meta_from_json(
$data, $meta);
}
1;
__END__
=encoding utf-8
=head1 NAME
MooseX::Role::JSONObject - create/store an object in a JSON-like hash
=head1 SY
seX::Role::JSONObject::Meta::Trait;
use v5.012;
use strict;
use warnings;
use version; our $VERSION = version->declare("v0.1.0");
use Moose::Role;
Moose::Util::meta_attribute_alias('JSONAttribute'
s => 'rw',
isa => 'Str',
predicate => 'has_json_attr',
);
1;
__END__
=encoding utf-8
=head1 NAME
MooseX::Role::JSONObject::Meta::Trait - rename a JSONObject attribute
=head1 SYNOPSIS
packa
oseX::Role::JSONObject::Meta::Trait;
with 'MooseX::Role::JSONObject';
has ipv4_address => (
is => 'rw',
isa => 'Str',
traits => ['JSONAttribute'],
json_attr => 'I
Mackerel::Webhook::Receiver;
use 5.008001;
use strict;
use warnings;
our $VERSION = "0.01";
use JSON;
use Plack::Request;
use Mackerel::Webhook::Receiver::Event;
use Class::Accessor::Lite (
ne
) {
return [400, [], ['BAD REQUEST']];
}
my $payload = eval { decode_json $req->content }
or return [400, [], ['BAD REQUEST']];
my $event_name = $payl
strict;
use warnings;
use base qw( SWISH::API::More::Results );
use Carp;
use YAML::Syck ();
use JSON::Syck ();
our $VERSION = '0.14';
*next = \&next_result;
sub next_result {
my $self = shift
ize\n$v";
}
return $s;
}
elsif ( $f eq 'json' && $v =~ m/^[\{\[\"]/o ) {
my $s;
eval { $s = JSON::Syck::Load($v); };
if ($@) {
croak "$@\nca
:UserAgent - StatsMix API user agent library.
=head1 VERSION
Version 0.07
=cut
use 5.006;
use JSON;
use Data::Dumper;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST PUT GET DELETE);
use WW