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
begin MetaPOD::JSON v1.1.0
{
"namespace":"Gentoo::Dependency::AST::Node::Dependency",
"interface":"class",
"inherits":"Gentoo::Dependency::AST::Node"
}
=end MetaPOD::JSON
=head1 AUTHOR
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};
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 {
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 $
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
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
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
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
#!/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{$
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 $
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*(.*
::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
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
est::MD5 qw(md5_hex);
use File::Basename;
use File::Slurp qw(read_file write_file);
use JSON qw(to_json from_json);
sub max_timestamp(@) { max map { (stat $_)[9] || 0 } @_ } # Obviously 9 is mtime
#
"couldn't cache $script->{path}";
write_file($config->{cache_file}, { atomic => 1 }, to_json($config->{cache}, {pretty => 1})) or warn "Couldn't save cache control file";
}
}
}, $class;
$config->{cache_file} ||= "$config->{cache_dir}/cache.json";
$config->{cache} = from_json( read_file($config->{cache_file}) ) if -f $config->{cache_file};
my $cache_
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
Graph::VERSION = '1.0.1';
}
# ABSTRACT: create JSON with graph data for Status Board iPad App
use strict;
use warnings;
use utf8;
use Carp;
use JSON;
use File::Slurp;
use Clone qw(clone);
my $tru
sub get_json {
my ($self) = @_;
my $json = to_json(
$self->__get_data()
);
return $json;
}
sub get_pretty_json {
my ($self) = @_;
my $pretty_json = to_json(
);
return $pretty_json;
}
sub write_json {
my ($self, $file_name) = @_;
write_file(
$file_name,
{binmode => ':utf8'},
$self->get_json(),
);
return $f
y ($ns) = @_;
if ( !$ns ) {
if ( -e "META.json" ) {
require JSON::Syck;
$ns = JSON::Syck::LoadFile("META.json")->{'name'};
}
elsif ( -e "META.yml"
ckage Net::Hadoop::HuahinManager;
use strict;
use warnings;
use Carp;
use URI::Escape qw//;
use JSON::XS qw//;
use Furl;
our $VERSION = "0.03";
sub new {
my ($this, %opts) = @_;
croak "Hu
if ($code == 200) {
if ($content_type =~ m!^application/json! and length($body) > 0) {
return JSON::XS::decode_json($body);
}
return 1;
}
# error
carp
d2 C<_boolean_type>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"String::Sections",
"interface":"class",
"inherits":"Moo::Object"
}
=end MetaPOD::JSON
=head1 DEVELOPMENT
This code is s