$VERSION = 'v3.9.4';
use Getopt::Long;
use Pod::Usage;
use MIME::Base64;
use LWP::UserAgent;
use JSON;
## no critic (Capitalization, RequireCarping)
# command line variables binds
my @pem;
next;
}
push @cert, $line;
}
close $fh or die "close: $!";
}
my $json_data = to_json( {'chain' => \@chain } );
while (my ($log_name, $log_url) = each %logs) {
write_log(
q = HTTP::Request->new('POST', $log_url . '/ct/v1/add-chain', ['Content-Type' => 'application/json'], $json_data);
my $res = $ua->request($req);
if (!$res->is_success) {
write_log('Fa
ins with a -, or whose key consists entirely of
nonword characters (thereby covering '=', '>', pg json ops, etc.) is
processed as an operator hashpair.
=head3 operator hashpair w/node type
If a node
package App::Beeminder::Hook;
use Dancer ':syntax';
use JSON::Any;
use autodie;
use Data::Dumper;
# ABSTRACT: Integrate Github and Beeminder
our $VERSION = '0.1';
# inspired by https://github.com/s
ram('payload');
unless ($p) {
my $response = JSON::Any->encode( { success => 0 } );
return $response;
}
$p = JSON::Any->new->decode( $p );
debug(Dumper($p));
my
config->{beeminder_goal},
);
debug "Running: $cmd";
system $cmd;
my $response = JSON::Any->encode( { success => 1 } );
};
get '/' => sub {
'This is App::Beeminder::Hook';
};
tr
my($self, $serialize) = @_;
my %serializers = (
json => [
sub { require JSON },
\&JSON::to_json,
\&JSON::from_json
],
storable => [
sub { require Storable },
t using this
while (my $dump = <$fh>) {
next if not $dump =~ /\S/;
foreach my $type (qw(json yaml simple)) {
eval {$tmphist = Math::SimpleHisto::XS->new_from_dump($type, $dump);};
ga::Result;
use File::Which qw(which);
use List::MoreUtils qw(any);
use URI;
use URI::Escape;
use JSON;
use Try::Tiny;
use Encode;
use base qw(Class::Accessor::Fast);
our $VERSION = '0.08';
__PACKAG
$url,
sub {
my $json = shift;
my $result;
try {
my $data = JSON->new->utf8->decode($json);
$result = AnyEvent::Groon
$cmd_cv->cb(
sub {
my $json = $stdout;
my $result;
try {
my $data = JSON->new->utf8->decode($json);
$result = AnyEvent::Groo
allow quick and easy
serialization. So a quick call to C<freeze> will serialize this object into
JSON and C<thaw> will inflate it. The only caveat is that we don't serialize
the C<value> attribute.
to refill forms or something.
my $json = $results->freeze({ format => 'JSON' });
# ...
my $results = Data::Verifier::Results->thaw($json, { format => 'JSON' });
=head1 INTERNALS
This module
] [--args json-string]
# Evaluate template in string
mason.pl [mason options] [--args json-string] -e "string"
# Evaluate template in file
mason.pl [mason options] [--args json-string] t
orary directory.
=head1 ADDITIONAL OPTIONS
=over
=item --args json-string
A hash of arguments to pass to the page component, in JSON form. e.g.
--args '{"count":5,"names":["Alice","Bob"]}'
=
package Collectd::Plugin::Write::Message::Passing;
use strict;
use warnings;
use Collectd ();
use JSON;
use Module::Runtime qw/ require_module /;
use String::RewritePrefix ();
use Try::Tiny;
use names
$@");
return 0;
}
$CONFIG{encoderclass} ||= '+Message::Passing::Filter::Encoder::JSON';
$CONFIG{encoderclass} = String::RewritePrefix->rewrite(
{ '' => 'Message::Passing::
2.168.0.1:5552"
</outputoptions>
# OPTIONAL - Defaults to JSON
#encoderclass "JSON"
#<encoderoptions>
# pretty "0"
#</encodero
use MooseX::Declare;
class App::PortDistances::Types {
use Carp;
use JSON;
use MooseX::Types -declare => [
qw/
File HoH StrArray
Coord Quadrant Hemispher
oH, from File, via {
local $/;
open my $IN, q{<}, $_ or confess $!;
JSON::decode_json(<$IN>);
};
coerce StrArray, from File, via {
open my $IN, q{<}, $_ or ret
e Data::Dumper;
use Fcntl qw( :DEFAULT :seek );
use File::Find;
use File::Spec::Functions ();
use JSON;
use Try::Tiny;
use strict;
use warnings;
use base qw(Exporter);
our @EXPORT_OK =
qw(can_load
file checksum combine_similar_paths dump_one_line find_wanted first_index is_absolute json_encode json_decode mason_canon_path read_file taint_is_on touch_file trim uniq write_file);
my $Fetch_Flags
::ISA[0] eq 'File::Spec::Unix';
# Map null, true and false to real Perl values
if ( JSON->VERSION < 2 ) {
$JSON::UnMapping = 1;
}
sub can_load {
# Load $class_name if possible. Return 1 if
se File::ShareDir;
use constant DB_FILE => File::ShareDir::dist_file('App-PortDistances', 'db.json');
use App::PortDistances::DB::Port;
use App::PortDistances::Types
qw/
t::Long;
use Mason;
use Mason::Util qw(json_decode);
use strict;
use warnings;
my $usage =
"usage: $0 [--data-dir dir] [--plugins Plugin1,Plugin2] [--args json-string] [-e source] [template-file]";
plugins} = [ split( /\s*,\s*/, $params{plugins} ) ];
}
my %run_args = defined($args) ? %{ json_decode($args) } : ();
my $tempdir = tempdir( 'mason-XXXX', TMPDIR => 1, CLEANUP => 1 );
il::TypeConstraints qw(enum);
use Try::Tiny;
use Data::Stream::Bulk::DBI;
use SQL::Abstract;
use JSON;
use Scalar::Util qw(weaken refaddr);
use List::MoreUtils qw(any);
use KiokuDB::Backend::DBI::Sc
}
}
has '+serializer' => ( default => "json" ); # to make dumps readable
has json => (
isa => "Object",
is => "ro",
default => sub { JSON->new },
);
has create => (
isa => "Boo
$i_sth->finish;
});
}
sub _parse_dbic_key {
my ( $self, $key ) = @_;
@{ $self->json->decode(substr($key,length('dbic:row:'))) };
}
sub _part_rows_and_ids {
my ( $self, $rows_an
r2;
use strict;
use warnings;
use WWW::Curl::Easy;
use Digest::MD5 qw( md5_hex );
use JSON::XS qw( decode_json );
use URI::Escape qw( uri_escape );
BEGIN {
use Exporter ();
use vars qw($VER
est {
my ($self, $params, $method) = @_;
my $response;
my $fields = join("&", "format=json", map { join("=", $_, uri_escape($params->{$_})) } keys %$params);
if ( $method and $method
{ method => "auth.getToken", api_key => $self->{"api_key"} });
$self->{"api_token"} = decode_json($response)->{"token"} || 0;
return $self->{"api_token"};
}
sub auth_getSession {
my ($s
Moose;
use JSON;
use Scalar::Util qw(weaken);
use namespace::autoclean;
with qw(KiokuDB::TypeMap::Entry);
has json => (
isa => "Object",
is => "ro",
default => sub { JSON->new },
);
sub compile {
my ( $self, $class ) = @_;
my $json = $self->json;
return KiokuDB::TypeMap::Entry::Compiled->new(
collapse_method => sub {
my ( $collapser, @args ) = @
id_method => sub {
my ( $self, $object ) = @_;
return 'dbic:row:' . $json->encode([ $object->result_source->source_name, $object->id ]);
},
refresh_method
default => App::PortDistances::DB::DB_FILE,
documentation => 'source database in JSON format',
);
has 'cache' => (
is => 'ro',
isa => 'St
ept: text/html form_field_name form_field_value
$ ./myapp POST / Content-Type: text/json Content: '{ "json": "here" }'
The body of the response is sent to STDOUT and the headers to STDERR, so
est_request(
POST => '/',
'Content-Type:' => 'text/json',
'Content:' => '{ "json": "here" }',
);
=head1 AUTHORS
See L<Web::Simple> for authors.
history of the changes to
the text. This is in the form of an array of hashes, serialized
using JSON.
The array is in the order in which the individual changes took
place. Each row has fields:
nfig no_ignore_case bundling );
use FindBin qw( $Bin );
use Emacs::Rep qw( :all );
use JSON; # encode_json
our $VERSION = 1.00;
my $prog = basename($0);
my $DEBUG = 0; # TO
se( $fout );
}
# serialize the data to pass to emacs
my $chg_md_json = encode_json( $change_metadata_aref );
print $chg_md_json;
}
### end main, into the subs
sub say_usage {
my $usage=<<"USE
enum 'AcceptType' => qw(application/json application/xml);
has accept_type => (
is => 'rw',
isa => 'AcceptType',
default => 'application/json',
);
has api_version => ( is => 'r