gs FATAL => 'all';
use Moo;
use Getopt::Long qw(GetOptionsFromArray);
use Try::Tiny;
use DBI;
use JSON;
=head1 NAME
App::Unicheck::Modules::MySQL - App::Unicheck module to check mysql connections an
, $value, $format) = @_;
return JSON->new->encode(
{
message => $value,
status => $status,
}
) if $format eq 'json';
# default last in case some n
mats => {
'num' => 'Returns the status code',
'json' => 'Returns a JSON structure',
},
},
},
}
}
=head1 AUTHOR
Matthi
l;
use strict;
use warnings;
use utf8;
use FindBin qw($Bin);
use File::Spec;
use Carp;
use JSON::XS;
use IPC::Open2;
our $VERSION = '0.02';
#=================================================
bin";
my $self = bless({
running => 0,
_path => $path,
_json => JSON::XS->new,
_ErrorHandle => $opt->{onError},
_js => $js,
pid => $$
{_path} }
sub json { shift->{_json} }
sub toJson { shift->{_json}->encode(@_) }
sub toObject { shift->{_json}->decode(@_) }
sub context
:
$HOME/.local/share/.path_isdev_heuristicset_fromconfig/config.json
$HOME/.path_isdev_heuristicset_fromconfig/config.json
Which ever one it is unfortunately dependent on the sort of mood Fi
n MetaPOD::JSON v1.1.0
{
"namespace":"Path::IsDev::HeuristicSet::FromConfig",
"interface":"single_class",
"does":"Path::IsDev::Role::HeuristicSet::Simple"
}
=end MetaPOD::JSON
=head1 A
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010000;
use autodie;
use Furl;
use JSON;
use GDBM_File;
use Digest::SHA1 qw/sha1_hex/;
use Encode;
my $secret = shift;
my $dup_path = '/
i.metacpan.org/release/_search?sort=date:desc&size=5');
$res->is_success or die;
my $dat = decode_json($res->content);
for my $dist (map { $_->{_source} } @{$dat->{hits}->{hits}}) {
next if $dup{$
=> sub { 'Path::IsDev::HeuristicSet::FromConfig' },
config_file => sub { 'config.json' },
config_file_full => sub { _path( $_[0]->config->configdir )->child( $_[0]->config_file ) },
=> $_[0]->dist,
module => $_[0]->module,
);
},
decoder => sub {
require JSON;
return JSON->new();
},
data => sub {
$_[0]->decoder->decode( $_[0]->config_file_full->slurp_
fig
=head2 C<config_file>
The name of the file relative to the configuration C<dir>
config.json
=head2 C<config_file_full>
The full path to the C<config> file.
If not specified, combined fro
al;
use strict;
use warnings;
use utf8;
use Furl;
use URI::Escape qw(uri_escape_utf8);
use JSON qw(decode_json);
use Text::Shorten qw(shorten_scalar);
use Mouse;
no Mouse;
sub lleval {
my ($src
;
$res->is_success or die $res->status_line;
print $res->content, "\n";
return decode_json($res->content);
}
sub init {
my ($self, $bot) = @_;
$bot->register(
qr/^!\s*(.*
use JSON qw(decode_json);
use Encode qw(encode_utf8 decode_utf8);
use Twiggy::Server;
use Plack::Builder;
use Module::Runtime;
use LiBot::Message;
sub handle_request {
my ($self, $bot, $json) =
text/plain'], [encode_utf8($ret || '')]]);
};
if ( $json && $json->{events} ) {
for my $event ( @{ $json->{events} } ) {
my $msg = LiBot::Message->new(
;
if ($req->method eq 'POST') {
my $json = decode_json($req->content);
return $self->handle_request($bot, $json);
} else {
# lingr server always ca
perl data to JSON & javascript JSON to perl data back again.
Saying that the over all speed is acceptable and you can take some steps to
improve speed like
=over 4
=item L<JSON::XS>
Make
sure you have L<JSON::XS> installed - this is important, JavaScript::Shell
uses JSON::Any to parse data and it will use any available JSON parser
but if you have JSON::XS installed in your system i
t will use it by default as
it's the fastest JSON parser available
=item Data Transfer
Try to transfer small data chunks between processes when possible, sending
large data will be very slow
WWW::Pusher;
{
$WWW::Pusher::VERSION = '0.0701';
}
use warnings;
use strict;
use 5.008;
use JSON;
use URI;
use LWP::UserAgent;
use Digest::MD5 qw(md5_hex);
use Digest::SHA qw(hmac_sha256_hex);
he event name should be a scalar, but data can also be hash/arrayref. There
should be no need to JSON encode your data.
Returns true on success, or undef on failure. Setting "debug" to a true value
self, %args) = @_;
my $time = time;
my $uri = $self->{uri}->clone;
my $payload = to_json($args{data}, { allow_nonref => 1 });
if($args{channel} && $args{channel} ne '')
{
$uri->path
rnings FATAL => 'all';
use Time::HiRes qw(gettimeofday);
use Math::Random::Secure qw(irand);
use JSON;
use MIME::Base64 qw(decode_base64 decode_base64url encode_base64url);
use Crypt::Mac::HMAC qw( h
nt "Net::PT - map = \n";
p $map;
my $json = encode_json $map;
print "Net:PT - json = \n";
p $json;
my $b64 = encode_base64url $json;
print "Net::PT - base64 url = \n";
p
et::PT - hmac = \n";
p $hmac;
my $json2 = decode_base64url $b64;
print "Net:PT - json2 = \n";
p $json2;
my $map2 = decode_json $json2;
print "Net:PT - map2 = \n";
p $
::Builder::Level = $Test::Builder::Level + 1;
my $metafile = first { -e $_ } qw/MYMETA.json MYMETA.yml META.json META.yml/ or return $builder->ok(0, "No META information provided\n");
my $meta = CPA
rnings FATAL => 'all';
use Time::HiRes qw(gettimeofday);
use Math::Random::Secure qw(irand);
use JSON;
use MIME::Base64 qw(decode_base64 decode_base64url encode_base64url);
use Crypt::Mac::HMAC qw( h
t::PT::Test - map = \n";
p $map;
my $json = encode_json $map;
print "Net:PT - json = \n";
p $json;
my $b64 = encode_base64url $json;
print "Net::PT::Test - base64 url = \n";
::Test - hmac = \n";
p $hmac;
my $json2 = decode_base64url $b64;
print "Net:PT - json2 = \n";
p $json2;
my $map2 = decode_json $json2;
print "Net:PT - map2 = \n";
p $
w(usleep nanosleep);
use Storable;
use Data::Dumper;
use Storable;
use Devel::Debug::Server;
use JSON;
use File::Spec;
# PODNAME: debugServer.pl
# ABSTRACT: The server to centralize debugging infor
6;
use strict;
use warnings FATAL => 'all';
use JSON::XS;
use LWP::UserAgent;
our $VERSION = '1.04';
# JSON object
my $json_xs = JSON::XS->new;
$json_xs->utf8(1);
my %connection_params = (
'se
json');
$request->content($json_xs->encode($params));
my $result = undef;
my $response = $ua->request($request);
if ($response->is_success) {
eval{
$result = $json
nd etc. This request then passed to one of cleantalk.org servers via HTTP + JSON. Server returns an answer encoded with JSON, this answer consist values indicates spam or not this comment/registration
ACT: get Ivan Bessarabov's sleep data
use strict;
use warnings;
use Carp;
use LWP::Simple;
use JSON;
use Time::Local;
my $true = 1;
my $false = '';
sub new {
my ($class, %opts) = @_;
cr
";
}
}
sub __get_data {
my ($self) = @_;
my $json = get("http://ivan.bessarabov.ru/sleep.json");
my $data = from_json($json);
my $day_data = $data->[0]->{day};
my %date2sle
he B<error()> method to get an error message as to why it failed.
Otherwise, they should return a JSON-decoded hashref as is directly from
filecloud.io (which may also contain an error).
=head2 fetch
API itself.
$error = $websvc->error() if ( !$result );
=head1 SEE ALSO
L<LWP::UserAgent>,
L<JSON>
L<http://filecloud.io> and L<https://code.google.com/p/filecloud/>
=head1 AUTHOR
Mitch McCrac
y ($ns) = @_;
if ( !$ns ) {
if ( -e "META.json" ) {
require JSON::Syck;
$ns = JSON::Syck::LoadFile("META.json")->{'name'};
}
elsif ( -e "META.yml"
r (similar to JSON::XS in our benchmarks)?
The power of this module is very similar to that of generating JSON, except it
can dump scalar references, dumps top-level non-references (JSON must be an a
ects).
L<JSON::XS> contains some excellent code that is very similar to
the code in this module for a reason: It solves a similar problem and
we included much of the code structure from JSON::XS. Tha
ent JSON::XS module due to obvious overlap in
problem domain.
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2012, 2013 by Steffen Mueller
Except portions taken from Marc Lehmann's code for the JSON::X
package WebService::Hatena::Graph;
use strict;
use warnings;
use Carp qw(croak);
use URI;
use JSON::Any;
use LWP::UserAgent;
our $VERSION = '0.08';
our $GraphHost = 'graph.hatena.ne.jp:80';
sub n
raphHost.'/api/data', (%args, type => 'json'));
croak (sprintf "%d: %s", $res->code, $res->message)
if $res->code != 200;
return JSON::Any->jsonToObj($res->content);
}
sub post_conf
phHost.'/api/config', (%args, type => 'json'));
croak (sprintf "%d: %s", $res->code, $res->message)
if $res->code != 200;
return JSON::Any->jsonToObj($res->content);
}
sub _get {
package Net::Postage::App;
use strict;
use warnings;
use JSON;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use MIME::Base64;
use File::Spec;
use Digest::SHA qw(sha1_hex);
our $VERSION =
ata}->{api_key} = $args->{api_key};
$self->{json} = JSON->new;
$self->{url} = $args->{url} || "http://api.postageapp.com/v.1.0/send_message.json";
$self->{ua} = LWP::UserAgent->new(agent =
}
return $self->{data};
}
sub send {
my $self = shift;
my $json = $self->{json};
my $data = $json->encode($self->{data});
my $ua = $self->{ua};
my $url = $self->{url};