Glacier::ListVaults;
our $VERSION = '1.120';
use strict;
use warnings;
use utf8;
use Carp;
use JSON::XS 1.00;
use App::MtAws::Utils;
use App::MtAws::MetaData;
sub new
{
my $class = shift;
my $
elf, $class;
$self;
}
sub _parse
{
my ($self) = @_;
return if $self->{data};
$self->{data} = JSON::XS->new->allow_nonref->decode(${ delete $self->{rawdata} || confess });
}
sub get_list_vaults
package LaTeXML::Plugin::LtxMojo;
use Mojo::Base 'Mojolicious';
use Mojo::JSON;
use Mojo::IOLoop;
use Mojo::ByteStream qw(b);
use File::Basename 'dirname';
use File::Spec::Functions qw(catdir catfile
stom';
# }
# }
$app->helper(convert_string => sub {
my ($self) = @_;
my ($source,$is_jsonp);
my $get_params = $self->req->url->query->params || [];
my $post_params = $self->req->body_
Smarter fix??)
while (my ($key,$value) = splice(@all_params,0,2)) {
# JSONP ?
if ($key eq 'jsonp') {
$is_jsonp = $value;
next;
} elsif ($key =~ /^(?:tex|source)$/) {
#
;
use Carp;
use Data::Dump qw( dump );
use JSON;
use Sort::SQL;
use Search::QueryParser::SQL;
our $VERSION = '0.006';
sub json_mime_type {'application/json'}
sub params_to_sql {
my $req = shift
olor )]
);
=head1 DESCRIPTION
Dezi::Admin utility functions.
=head1 FUNCTIONS
=head2 json_mime_type
Returns appropriate MIME type string.
=head2 params_to_sql( I<plack_request>, I<table
dmin::API;
use strict;
use warnings;
use Carp;
use Plack::Builder;
use Data::Dump qw( dump );
use JSON;
use Dezi::Admin::API::Indexes;
our $VERSION = '0.006';
=head1 NAME
Dezi::Admin::API - Dezi ad
};
$resp->body( to_json($about) );
$resp->status(200);
$resp->content_type('application/json');
return $resp->finalize();
stash_key => 'message',
default => 'application/json',
map => {
'application/json' => 'JSON',
'text/x-json' => 'JSON',
},
);
around create_action => sub {
my
stash_key => 'message',
default => 'application/json',
map => {
'application/json' => 'JSON',
'text/x-json' => 'JSON',
},
);
See L<Catalyst::Action::Deserialize>
SION} );
use Carp;
use Data::Dump qw( dump );
use Parallel::Iterator qw( iterate_as_array );
use JSON;
use LWP::UserAgent;
use Scalar::Util qw( blessed );
use Search::Tools::XML;
use Data::Transforme
my $highest_score = 0;
if ( $resp->content_type eq 'application/json' ) {
my $r = decode_json( $resp->content );
if ( $r->{results} ) {
@resp_re
W::Google::AutoSuggest;
use WWW::Google::AutoSuggest::Obj -base;
use LWP::UserAgent;
use URI;
use JSON;
use Encode;
our $VERSION = '0.04';
=encoding utf-8
=head1 NAME
WWW::Google::AutoSuggest - Qu
ogle::AutoSuggest->new(domain=> "it" ,json=>1); #uses www.google.it instead of .com
my $result = $AutoSuggest->search("perl");
# $result now is a decoded JSON arrayref
###### or with the html ta
returning it as decoded JSON for further inspection
=head1 ARGUMENTS
=over 4
=item json
my $AutoSuggest=WWW::Google::AutoSuggest->new(json=>1);
or
$AutoSuggest->json(1);
Explicitally enabl
se 'Role';
use JSON;
# ABSTRACT: Any::Moose role for encoding Sque structures
#
# =attr encoder
#
# JSON encoder by default.
#
# =cut
has encoder => ( is => 'ro', default => sub { JSON->new->utf8 } )
::Dumper;
use Net::SSL (); # From Crypt-SSLeay
use LWP::UserAgent;
use HTTP::Cookies;
use JSON qw( decode_json );
use DeathByCaptcha::SocketClient;
$Net::HTTPS::SSL_SOCKET_CLASS = "Net::SSL"; # For
password;
my $post_data = {'user' => $username,
'passwd' => $password,
'api_type' => 'json',
'op' => 'login'
};
$self->browser->default_header('Referer' => "http://www.reddit.
ult_header('Connection' => 'keep-alive');
$self->browser->default_header('Accept' => 'application/json, text/javascript, */*; q=0.01');
$self->browser->default_header('X-Requested-With' => 'XMLHttpReq
eter;
use JSON;
sub new {
my ($class, $machine_type) = @_;
my $self = {};
bless $self, $class;
$self->{INTERPRETER} = Gcode::Interpreter->new($machine_type);
$self->{JSON} = JSON->new();
#$self->{JSON}->pretty(1);
$self->{WAYPOINT_LINES} = 0;
$self->{META_FILE} = undef;
return $self;
}
sub set_meta_file {
my ($self, $file) = @_;
$self->{META_FILE} = $file;
return 1;
}
open meta file $tmp_meta to write to it: $!\n";
return 0;
}
my $json = $self->{JSON}->encode($data);
print META $json;
foreach my $key (sort keys %$data) {
print "$key: " . $data->{$k
'rw', isa => 'ArrayRef', default => sub {[]} );
coerce 'HashRef'
=> from 'Str'
=> via { JSON->new->utf8->decode($_) };
has payload => (
is => 'rw',
isa => 'HashRef',
coerce => 1
l be coerced using JSON decoder.
This is read-only.
=head2 frame
Raw stomp frame representing the job.
This is read-only.
=head1 METHODS
=head2 encode
String representation(JSON) to be used on th
=> 1, # include results
t => 'XML', # or JSON
u => 'http://yourdomain.foo/opensearch/',
b => 'AND', #
p qw( dump );
use Plack::Util::Accessor qw(
debug
conn
table_name
searcher
);
use JSON;
use Plack::Middleware::REST::Util;
use Dezi::Admin::Utils;
use Dezi::Admin::API::Response;
use T
undef;
if ( !$method ) {
$resp->status(404);
$resp->body(
encode_json(
{ code => 404,
success => 0,
error
;
}
$resp->status(200) unless $resp->status;
$resp->content_type(Dezi::Admin::Utils::json_mime_type)
unless $resp->content_type;
return $resp->finalize;
}
1;
__END__
=head
Component );
use Data::Dump qw( dump );
use Plack::Util::Accessor qw(
debug
engine
);
use JSON;
use Plack::Middleware::REST::Util;
use Dezi::Admin::Utils;
use Dezi::Admin::API::Response;
our
esponse;
$resp->status(200) unless $resp->status;
$resp->content_type(Dezi::Admin::Utils::json_mime_type)
unless $resp->content_type;
$resp->body($idx);
return $resp->finalize;
esponse;
$resp->status(200) unless $resp->status;
$resp->content_type(Dezi::Admin::Utils::json_mime_type)
unless $resp->content_type;
$resp->body("$list");
return $resp->finali
erload
'""' => sub { $_[0]->stringify; },
'bool' => sub {1},
fallback => 1;
use JSON;
use Plack::Util::Accessor qw(
total
success
results
metaData
);
sub new {
m
s,
};
return bless $self, $class;
}
sub stringify {
my $self = shift;
return to_json( {%$self} );
}
1;
__END__
=head1 NAME
Dezi::Admin::API::Response - Dezi administration API re
total,
results => $list,
);
print $resp; # renders as JSON
=head1 DESCRIPTION
Dezi::Admin::API::Response represents a JSON response to an API call.
=head1 METHODS
=head2 new( I<args
:SocketClient;
use strict;
use warnings;
our $VERSION = '0.01';
use IO::Socket;
use JSON qw(encode_json decode_json);
use MIME::Base64 qw(encode_base64);
use DeathByCaptcha::Exception;
use base 'Dea
DeathByCaptcha::Client::API_VERSION,
"cmd" => $cmd};
my $request = encode_json($cmdargs);
#printf("%d SEND: %d %s\n", time, length($request), $request);
$request .= +AP
\n", time, length($buff), $buff);
my $response;
eval { $response = decode_json($buff); };
if (defined $response) {
if (defined $response->{"error"})
JSON qw(decode_json);
use DeathByCaptcha::Exception;
use base 'DeathByCaptcha::Client';
use constant API_SERVER_URL => 'http://api.dbcapi.me/api';
use constant API_RESPONSE_TYPE => 'application/json
ccess forbidden, check your credentials"
);
}
my $user;
eval { $user = decode_json($response->content()); };
return (defined $user and 0 < $user->{"user"}) ? $user : undef;
}
Status::RC_OK == $response->code) {
my $captcha;
eval { $captcha = decode_json($response->content); };
if (defined $captcha and 0 < $captcha->{"captcha"}) {
use warnings;
package WebService::Freebox;
# ABSTRACT: Freebox API wrappers.
use Mouse;
use JSON;
use REST::Client;
our $VERSION = '0.001'; # VERSION
has app_id => ( is => 'ro', isa => 'Str',
ttp://mafreebox.freebox.fr');
$c->addHeader('Accept', 'application/json');
$c->addHeader('Content-Type', 'application/json');
return $c;
}
# Wrapper around REST::Client request() checkin
die qq{$errmsg ("$request $url" failed with HTTP error $errcode).\n}
}
return decode_json $c->responseContent()
}
# Helper for making normal API requests, i.e. all except for the initial
vailable in JSON, with the additional limitation that only simple keys are
supported.
As a result, all possible Tiny YAML documents should be able to be transformed
into an equivalent JSON document,
ef
push @INC, '/', @base;
};
use parent qw { Chef Chef::Header };
use LWP::UserAgent;
use Mojo::JSON;
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
bless $self, $class;
return $response;
}
sub post
{
my $self = shift;
my $param = {@_};
my $mojo_json = new Mojo::JSON();
my $response = $self->add_headers(
$self->header(
'Path' => $param->{'api_end_point'},
'Content' => $mojo_json->encode($param->{'data'})
)->hash
)