encoding utf-8
=head1 NAME
JSON::TypeInference::Type - Classes of JSON types
=head1 DESCRIPTION
The implementations of JSON::TypeInference::Type represent types of JSON values.
They must implemen
DF::Trine::Serializer::RDFXML;
use RDF::Trine::Serializer::Turtle;
use RDF::Trine::Serializer::RDFJSON;
use RDF::Trine::Parser;
use RDF::Lazy::Node;
use Scalar::Util qw(blessed refaddr);
use Carp qw(
> $self->{namespaces} ),
@_
);
}
*ttl = *turtle;
sub rdfjson {
shift->_serialize( RDF::Trine::Serializer::RDFJSON->new, @_ );
}
sub rdfxml {
my $self = shift;
$self->_serial
mp in RDF/Turtle, wrapped in a HTML <pre> tag
$g->rdfxml; # dump in RDF/XML
$g->rdfjson; # dump in RDF/JSON
=head1 DESCRIPTION
This module wraps L<RDF::Trine::Node> to provide simple node-centr
strict;
use warnings;
our $VERSION = '0.01';
use base 'SMS::Send::Driver';
use MIME::Base64;
use JSON;
use Data::Dumper;
sub new {
my ($class, %args) = @_;
die "$class needs hash_ref with _login a
t as _sender to new. Max 11 chars.
return $self;
}
sub send_sms {
my ($self, %args) = @_;
my $json_args = {
text => "$args{'text'}",
to => "sms:$args{'to'}"
e => "text",
sms_originator_text => "$self->{_sender}"
};
my $response = _post($self, to_json($json_args));
if ($response->{status} eq "200") {
return 1;
}
return 0;
}
sub _post {
my ($se
TRACT: Load configs from files and the environment
use Moo;
use warnings NONFATAL => 'all';
use JSON::MaybeXS;
use IO::All;
use Try::Tiny;
use Module::Runtime 'use_module';
has _debug => (
is =>
zy => 1,
builder => sub { \&decode_json },
);
has _encode_via => (
is => 'ro',
init_arg => 'encode_via',
lazy => 1,
builder => sub { \&encode_json },
);
sub _io { io->file(shift->_loc
>new(
config_class => 'MyApp::Config',
env_key => 'MYAPP',
location => '.config.json',
);
my $config = $station->load;
=head1 DESCRIPTION
This config loader offers a couple of m
req = POST('http://example.com/foo?param=value&pet=dog',
Content_Type => 'application/json',
Content_MD5 => 'Sd/dVLAcvNLSq16eXua5uQ==',
Content_Length => 18,
req = POST('http://example.com/foo?param=value&pet=dog',
Content_Type => 'application/json',
Content_MD5 => 'Sd/dVLAcvNLSq16eXua5uQ==',
Content_Length => 18,
mbridge::VERSION = '0.02';
use Moose;
use HTTP::Request;
use LWP::UserAgent;
use URI::Encode;
use JSON;
use namespace::autoclean;
with 'Dictionary::Cambridge::Response';
has "base_url" => (
is
=> 'ro',
isa => 'URI::Encode',
lazy_build => 1
);
has "json" => (
is => 'ro',
isa => 'JSON',
lazy_build => 1
);
sub _build_user_agent {
return LWP::Use
Request->new();
}
sub _build_encode_uri {
return URI::Encode->new();
}
sub _build_json {
return JSON->new()->utf8;
}
sub get_entry {
my ( $self, $word ) = @_;
my $response;
} = 1;
}
return $self->render(json => $aResponse);
}
else {
$aResponse->{error} = 1;
return $self->render(json => $aResponse);
}
}
);
$r->rout
r::Util qw(blessed);
use IO::Socket;
use Socket qw(TCP_NODELAY IPPROTO_TCP);
use Const::Fast;
use JSON;
use Carp;
use Module::Runtime qw(use_module);
use Moo;
# ABSTRACT: Fast and lightweight Perl cl
$vclock ) =
$check->(@_);
( $content_type ||= 'application/json' ) eq 'application/json'
and $value = encode_json($value);
$self->_store( $bucket, $key, $value, $content_type, $i
$check->(@_);
my @args;
push @args, ref($request) ? encode_json($request) : $request;
push @args, 'application/json';
push @args, $callback if $callback;
$self->map_reduce_raw(
e:
use PerlX::QuoteOperator::URL 'qh';
use JSON qw(decode_json);
say decode_json( qh{ http://twitter.com/statuses/show/6592721580.json } )->{text};
# => "He nose the truth."
=
ata};
my $ret = $cl->call(
"POST", "1.0", "user",
user => undef,
ref => $self->req->json->{data},
);
my $ret = $cl->call( "DELETE", "1.0", "user", user => $self->param("user_id") );
use utf8;
use Modern::Perl;
use Data::Dumper;
use LWP::UserAgent;
use Storable qw/ dclone /;
use JSON::XS;
use Moo;
has 'ua' => (
is => 'ro',
default => sub {
my $ua = LWP::UserAgent
state $json = JSON::XS->new->utf8;
$body = $json->encode( $params );
$request->content( $body );
}
$request->header( 'content-type' => 'application/json; charset=UTF
ss $response;
my $json = JSON::XS::decode_json( $response );
my $next = '';
if ( defined $json->{links} && defined $json->{links}->{next} ) {
$next = $json->{links}->{next};
chmark::Forking qw(timethis timethese cmpthese);
use Time::Out qw(timeout);
use Time::HiRes;
use JSON;
use Net::Riak;
use Data::Riak;
use Data::Riak::Fast;
use Riak::Tiny;
use FindBin qw($Bin);
use
foo_data_riak',
riak => $data_riak_client
}
);
$data_riak_bucket->add( key => encode_json($hash) );
my $data_riak_fast_client = Data::Riak::Fast->new(
{ transport => Data::Riak::Fa
ast',
riak => $data_riak_fast_client
}
);
$data_riak_fast_bucket->add( key => encode_json($hash) );
my $riak_tiny_client = Riak::Tiny->new( host => 'http://127.0.0.1:8098' );
cmpthese(
($status, $expires, @rr) = @_;
if ($status == EV::ADNS::s_ok) {
use JSON::XS;
warn encode_json \@rr;
}
}
The format of result records varies considerably, here is som
e warnings;
our $VERSION = '0.6.1'; # VERSION
use attributes;
use JSON::XS;
use Mojo::UserAgent;
use Data::Dumper;
use Mojo::JSON;
sub new {
my $that = shift;
my $proto = ref($that) || $t
$self->{endpoint};
}
sub get_plugins {
my ($self) = @_;
$self->_get("/plugins")->res->json;
}
sub auth {
my ( $self, $user, $pass ) = @_;
my ( $proto, $endpoint ) =
( $self-
elf->_ua->post( "$proto$user:$pass\@$endpoint/1.0/user/login",
json => {} )->res->json;
if ( $ref->{ok} == Mojo::JSON->true ) {
return $ref->{data};
}
return 0;
}
sub _u
qw(timethis timethese cmpthese);
use Net::Riak;
use Time::Out qw(timeout);
use Time::HiRes;
use JSON;
use FindBin qw($Bin);
use lib "$Bin/../lib";
use Riak::Light;
die "please set the RIAK_PBC_HOS
foo_data_riak',
riak => $data_riak_client
}
);
$data_riak_bucket->add( key => encode_json($hash) );
use Data::Riak::Fast;
my $data_riak_fast_client = Data::Riak::Fast->new(
{ tran
ey => encode_json($hash) );
use Riak::Tiny;
my $riak_tiny_client = Riak::Tiny->new( host => 'http://127.0.0.1:8098' );
$riak_tiny_client->new_object( foo_riak_tiny => key => encode_json($hash) );
afc',
);
# return link for open in browser
say $oauth->get_code();
# return JSON with access_token
say Dumper $oauth->get_token( code => 3557461 );
=head1 DESCRIPTION
Yande
oauth-intro-docpage/
=cut
package Yandex::OAuth;
use 5.008001;
use utf8;
use Modern::Perl;
use JSON::XS;
use URI::Escape;
use LWP::UserAgent;
use Moo;
our $VERSION = "0.07";
has 'ua' => (
i
return a json with access_token or error if code has expired
$oauth->get_token( code => XXXXXX );
=cut
sub get_token {
my ( $self, %params ) = @_;
return JSON::XS::decode_json( $self->
TheGameCrafter::Client::VERSION = '0.0103';
}
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON;
use URI;
use Ouch;
use parent 'Exporter';
our @EXPORT = qw(tgc_get tgc_delete tgc_put tgc_post)
request( @_ ));
}
sub _process_response {
my $response = shift;
my $result = eval { from_json($response->decoded_content) };
if ($@) {
ouch 500, 'Server returned unparsable conte
ult->{error}{data};
}
}
=head1 PREREQS
L<LWP::UserAgent>
L<Ouch>
L<HTTP::Request::Common>
L<JSON>
L<URI>
=head1 SUPPORT
=over
=item Repository
L<http://github.com/rizen/TheGameCrafter-Client
the truly REST. Catalyst::Controller::REST and
CatalystX::Eta::Controller::REST only implement a JSON/YAML response, but lot of people would call those applications REST.
Please do not use XML respo
heckbox;
use Tk::FormUI::Field::Combobox;
use Tk::FormUI::Field::Directory;
use Data::Dumper;
use JSON;
use Try::Tiny;
## Version string
our $VERSION = qq{1.07};
Readonly::Scalar our $READONLY =>
ialize($param)
=over 2
=item B<Description>
initialize the form from a HASH reference, JSON string, or JSON file.
In all cases, the hash should have the following format
{
title => 'My Form
,
],
}
]
}
=item B<Parameters>
$param - HASH reference, or scalar containin JSON string, or filename
=item B<Return>
NONE
=back
=cut
##--------------------------------------
package Catalyst::TraitFor::Request::QueryFromJSONY;
use Moo::Role;
use JSONY;
our $VERSION = '0.002';
has query_data_options => (
is=>'ro',
required=>1,
lazy=>1,
builder=>'build_query_data
$param, $err) = @_; die $err },
};
}
has _jsony => (
is=>'ro',
required=>1,
lazy=>1,
builder=>'build_jsony');
sub build_jsony { JSONY->new }
has _query_data_cache => (
is=>'ro',
->{$_} :
$local_options{param_missing}->($self, $_);
my $deserialized = eval { $self->_jsony->load($val) }
|| $local_options{parse_error}->($self, $val, $@);
$self->_query_data_