n 0.02
=cut
our $VERSION = '0.02';
use Carp qw(cluck);
use Data::Dumper;
use REST::Client;
use JSON::XS;
use URI;
use Scalar::Util qw(blessed reftype);
use Readonly;
use Exporter 'import';
use Mou
de_json( $response->responseContent() ) };
if ($@) {
cluck( "Cannot parse response content "
. $response->responseContent()
. ", error msg: $@. Is this JSON?"
s = {
'Content-Type' => 'application/json',
Authorization => $key
};
my $response =
eval { $self->ua->POST( $url, encode_json($data), $headers ); };
cluck($@) if $@;
ogger::Stdout;
use strict;
use warnings;
use base 'Flower::Chronos::Logger::Base';
#use Data::Printer;
#use JSON ();
sub log {
my $self = shift;
my ($info) = @_;
return $info;
}
1;
package Flower::Chronos::Report;
use strict;
use warnings;
use Time::Piece;
use JSON ();
use Digest::MD5 ();
use Flower::Chronos::Utils qw(parse_time);
use Encode;
sub new {
my $class =
ne = <$fh>)) {
chomp $line;
next unless $line;
my $record = eval { JSON::decode_json($line) };
next unless $record;
my $start = $record->{_start};
my
proved)$';
Readonly our $REGEX_FILETYPES => '^(android|docx|ios|gettext|html|xlsx|javaProperties|json|pptx|xliff|xlsx|xml|yaml)$';
Readonly our $REGEX_FILEURI => '^\S+$';
Readonly our $REGEX_INT
use JSON::XS;
use AnyEvent;
use Scalar::Util qw/refaddr/;
use Carp qw/confess/;
use overload '""' => \&to_string;
use Data::UUID;
my $uuid = Data::UUID->new();
my $timeout = 60;
my $json
= JSON::XS->new->allow_nonref;
#my $json = JSON->new();
sub new {
my $class = shift;
confess "called as object method" if ref $class;
my $args = shift || {};
confess "no parent supplie
my $url = "https://" . $self->ip . ":" . $self->port . "/REST/1.0/ping?";
my $nodedata = $json->encode($all_nodes);
$self->{ping_ua} = Mojo::UserAgent->new;
$self->{ping_cv} = AE::cv;
$self);
my %original = %{ $self->uid->from_store ? $self->_source : {} };
my $json = $self->model->json;
my %old;
my ( $o, $c, $o_str, $c_str );
my $meta = Class::MOP::class_
ete $original{$key}, $current->{$key} );
( $o_str, $c_str )
= map { ref $_ ? $json->encode($_) : $_ } ( $o, $c );
if ( $o_str ne $c_str ) {
$old{$key} = $meta-
ious policies. It will also update the
list of build prereqs, according to F<META.yml> (or F<META.json>)
shipped with the distribution.
Note that this command will abort if it finds that the spec is
strict;
use warnings;
use LWP;
use LWP::Simple;
use HTTP::Request;
use HTTP::Request::Common;
use JSON;
use Digest::HMAC_SHA1 qw(hmac_sha1_hex);
=head1 NAME
WWW::Freebox - Access to FreeboxOS API
=
oxOS API
my $content = [download_dir => 'path', download_file => ['file.torrent']];
my $jsonResponse = $fbx->request("downloads/add", 1, $content);
}
You can find more informations
=cut
sub new {
my $class = shift;
my $self = {
freebox => shift
};
my $content = decode_json(get("http://".$self->{freebox}."/api_version") or die("Can't access to http://".$self->{freebox}.
$distdir = path( glob "BUILD/*" );
my $metafile;
foreach my $meta ( "MYMETA.json", "MYMETA.yml", "META.json", "META.yml" ) {
next unless -e $distdir->child( $meta );
$metafile
p {
( /^[A-Z]+$/ && ! /^MANIFEST/ ) ||
m{^(Change(s|log)|MYMETA.yml|META.(json|yml)|e[gx]|(ex|s)amples?|demos?)$}i
}
map { $_->basename }
$distdir->chi
se 'Mojolicious::Controller';
use JSON::XS;
use Number::Format qw/format_bytes/;
use Data::FreqConvert;
my $json = JSON::XS->new->allow_nonref;
#my $json = JSON::XS->new->allow_nonref();
# resp
a ping
sub ping {
my $self = shift;
my $config = $self->config;
my $nodes = $self->req->json;
# Add all the nodes that have been advertised to us by the pinger.
foreach (@$nodes) {
UID
$config->{nodes}->add_if_necessary($_)
if ( $_->{uuid} );
}
$self->render(
json => { result => 'ok', 'uuid' => $config->{nodes}->self->uuid } );
}
# list my files
sub files {
ey => 'Gmjtd|lu6t2luan5%2C72%3Do5-larsq',
maxMatches => 50,
origin => 91506,
radius => 30,
units => 'm',
);
say $ua->get($url)->res->json('/searchResults')->;
package WWW::KrispyKreme::HotLight;
use Mojo::Base -base;
use Mojo::UserAgent;
use Mojo::JSON ();
our $VERSION = '1.1';
has 'where';
has locations => \&_build_locations;
sub _build_locations {
search => Mojo::JSON::encode_json($search),
};
my $json = $ua->get(
$hotlight_url => $header => form => $form,
)->res->json;
[map $_->{Location}, @$json];
}
1;
__END__
=
Firefox;
use strict;
use warnings;
use base 'Flower::Chronos::Application::Base';
use URI;
use JSON ();
sub run {
my $self = shift;
my ($info) = @_;
return
unless $info->{rol
1;
}
sub _find_current_url {
my $self = shift;
my $json = $self->_parse_current_session;
my @tabs;
foreach my $w (@{$json->{"windows"}}) {
foreach my $t (@{$w->{"tabs"}}) {
urrent_session {
my $self = shift;
my $session = $self->_slurp_session;
return JSON::decode_json($session);
}
sub _slurp_session {
my $self = shift;
my ($session_file) =
gl
-free and document oriented
Elasticsearch stores your objects as JSON documents. Most Perl objects
can be mapped easily to their JSON equivalent.
It is schema free, in that you don't need to define
your
field/properties/attributes ahead of time; you can just toss it a JSON
document and it'll try to autodetect data types and index your doc. That
said, the power of full text search comes from the
leted();
use Scalar::Util qw(blessed refaddr weaken);
use List::MoreUtils qw(uniq);
use JSON();
our $JSON = JSON->new->canonical->utf8;
use namespace::autoclean;
my @wrapped_classes = qw(
domain
;
delete $mapping{type};
return \%mapping;
}
#===================================
sub json {$JSON}
#===================================
1;
=pod
=encoding UTF-8
=head1 NAME
Elastic::Model
late
an object which does L<Elastic::Model::Role::Doc> into a hash ref
suitable for conversion to JSON.
=head3 deflators
$deflators = $model->deflators
A hashref which caches all of the deflato
> $treex_root );
=head1 DESCRIPTION
Wrapper around regular L<Treex::Core::Node> to provide L<TO_JSON>
method used for converting Treex structure to simple Perl hashes and
arrays.
=head1 IMPORTED CO
andled data type: $decl";
}
return $data;
}
=head2 TO_JSON
Called by L<JSON> package while converting blessed items
=cut
sub TO_JSON {
my $self = shift;
my $n = $self->node;
my $dat
package Net::Linkedin::OAuth2;
use strict;
use warnings;
use JSON::Any;
use LWP::UserAgent;
use Carp 'confess';
use XML::Hash;
use Digest::MD5 'md5_hex';
require Exporter;
our @ISA = qw(Exporter);
=> 'https://api.linkedin.com/v1/people/~:(id,formatted-name,picture-url,email-address)?format=json',
token => $token_object->{access_token}
);
# we have the email address
if ($result->{ema
=> 'https://api.linkedin.com/v1/people/~:(id,formatted-name,picture-url,email-address)?format=json',
token => $token_object->{access_token} );
if ($result->{emailAddress}) {
# we have t
t to JSON
use Moose;
use Treex::Core::Document;
use Treex::Core::TredView;
use Treex::Core::TredView::Labels;
use Treex::PML::Factory;
use Treex::View::TreeLayout;
use Treex::View::Node;
use JSON;
u
);
push @bundles, \%bundle;
}
my $json = JSON->new->allow_nonref->allow_blessed->convert_blessed;
$json = $json->pretty if $pretty;
return $json->encode(\@bundles);
}
__PACKAGE__->meta-
k> so to change that try:
rpc_serialized_client_inet:
data_serializer:
serializer: 'JSON::Syck'
=head1 SEE ALSO
=over 4
=item L<RPC::Serialized>
=back
=head1 AUTHOR
Oliver Gorwits
s_in) = @_;
my (@cmd, $single, @paths, $cmd_str, @su, $json, $tests);
# TESTING
# println subname(); ##i
# load JSON module
require JSON::Tiny;
# paths must be sent
if (! defined $paths_i
'-c',
$cmd_str,
);
# run command, get results
$json = capturex(@su);
# decode json
eval {
$tests = JSON::Tiny::decode_json($json);
};
# throw error if unable to decode
if (! $test
ternal {
my (@paths) = @_;
my ($rv);
# TESTING
# println subname(); ##i
# load JSON module
require JSON::Tiny;
# initialize return hashref
$rv = {};
# loop through paths
PATH_LOOP: