es/%d.json", $self->_id()));
$uri->query_form('limit' => 13, 'offset' => 0); # TODO: Suitable limit (and use offset?)
} elsif ($page == PAGE_PHOTOS) {
$uri->path("/iphone/api/v1/photos.json");
set?)
} elsif ($page == PAGE_REVIEWS) {
$uri->path(sprintf("/iphone/api/v1/movies/%d/reviews.json", $self->_id()));
$uri->query_form('type' => 'critics', 'limit' => 100, 'offset' => 0); # TODO:
v1/movies/%d.json", $id));
my $content = $self->_ws()->_response_decoded_content(GET $uri->as_string());
if ($content =~ m/^\s*$/) {
croak "Resource not found";
}
my $json = $self->_ws
::OpenStack::Attack;
use v5.10;
use Any::Moose;
use HTTP::Async;
use HTTP::Request;
use JSON qw(to_json from_json);
our $VERSION = '1.0500'; # VERSION
has compute => (is => 'ro', isa => 'Net::OpenSt
ers {
my ($self, $num, $image) = @_;
$image ||= $self->get_any_image();
my $body = to_json {
server => {
name => 'stackattack',
imageRef => $image,
{
my ($self, $servers, $image) = @_;
$image ||= $self->get_any_image();
my $body = to_json {
rebuild => {
imageRef => $image,
}
};
my @reqs = map $self
ath(sprintf("/name/%s/maindetails", $nconst));
my $content = $self->_ws()->_response_decoded_json(GET $uri->as_string());
if ($content->{'nconst'} ne $nconst) {
die "nconst failed round tri
th(sprintf("/title/%s/maindetails", $tconst));
my $content = $self->_ws()->_response_decoded_json(GET $uri->as_string());
if ($content->{'tconst'} ne $tconst) {
die "tconst failed round tri
acuna::Client::Module; # base module class
use Data::Dumper ();
use YAML::Any ();
#our @ISA = qw(JSON::RPC::Client);
use Class::XSAccessor {
getters => [qw(
rpc
uri name password api_key
The return values of the methods are (currently) just exactly C<result> portion
of the deflated JSON responses. This is subject to change!
On failure, the methods C<croak> with a simple to parse me
(Log out happens in the
destructor.)
All methods that take a session id as first argument in the
JSON-RPC API B<DO NOT REQUIRE> that you pass the session_id
manually. This is handled internally and t
::Utils::verify_buffer($buf) and last;
}
$sock->close();
return $buf ? Clutch::Utils::json->decode($buf) : undef;
}
sub request_multi {
my ($self, $args) = @_;
$self->_verify_mult
emove($sock);
$sock->close();
$res[$idx] = $buf ? Clutch::Utils::json->decode($buf) : undef;
}
}
}
wantarray ? @res : \@res;
}
package
Cl
lements
HashRef | {} | Less than 259,080 characters when converted to JSON
=head1 TYPES
The following types may be used to define attributes in L<SimpleDB::Class::Item>s.
derations about this type.
=head2 HashRef
A hash reference. For storage this is serialized into JSON and stored as a C<MediumStr>, therefore it cannot exceed 259,080 characters after serialization.
o your items.
=cut
use warnings;
use strict;
use DateTime;
use DateTime::Format::Strptime;
use JSON;
use MooseX::Types
-declare => [qw(SdbArrayRefOfDateTime SdbDateTime
SdbArrayRefOfS
ally casts date fields as L<DateTime> objects.
=item *
It automatically serializes hashes into JSON so they can be stored in SimpleDB domain attributes, and deserializes on retrieval.
=item *
It
s];
}
return $domains;
}
=head1 PREREQS
This package requires the following modules:
L<JSON>
L<Sub::Name>
L<DateTime>
L<DateTime::Format::Strptime>
L<Moose>
L<MooseX::Types>
L<MooseX::Class
A[name=brca1&namespace=geneid&format=html]]></data>
<response>
<content-type>text/json</content-type>
<contains>BRCA1</contains>
</response>
</post-test>
<pos
ta><![CDATA[namespace=geneid&action=table]]></data>
<response>
<content-type>text/json</content-type>
<contains>Alternate_name</contains>
<contains>Gene_Symbol</conta
imeout>5</timeout>
<url>![CDATA[...]]></url>
<response>
<content-type>text/json</content-type>
<contains>...</contains>
<equal>...</equal>
</response>
__content()->{$page};
if (! defined $content) {
$content = $self->_ws()->_response_decoded_json($self->_request($page));
$self->__content()->{$page} = $content;
}
return $content;
}
vice.
=head1 METHODS
The following methods are available from this class.
=cut
use Moose;
use JSON;
use DateTime;
use DateTime::Format::Strptime;
use Clone qw(clone);
#---------------------------
Socket::INET;
use POSIX qw(EINTR EAGAIN EWOULDBLOCK);
use Socket qw(IPPROTO_TCP TCP_NODELAY);
use JSON::XS ();
our $CRLF = "\x0d\x0a";
our $DELIMITER = "\x20";
our $MAX_REQUEST_SIZE = 131072;
o
'request' => 1,
'request_background' => 1,
'request_multi' => 1,
);
our $JSON;
sub new_client {
my $address = shift;
my $sock = IO::Socket::INET->new(
PeerAd
ROTO_TCP, TCP_NODELAY, pack("l", 1)) or die;
$sock->autoflush(1);
$sock;
}
sub json {
$JSON ||= JSON::XS->new->allow_nonref;
}
sub support_cmd {
$CMD2NO{+shift};
}
sub make_request
ad1 VERSION
Version 0.08
=cut
our $VERSION = '0.08';
use base qw(Net::MessageBus::Base);
use JSON;
use IO::Select;
use IO::Socket::INET;
use Net::MessageBus::Message;
#handle gracefully the dea
$request = from_json($text);
};
if ($@) {
print $fh to_json({status => 0, status_message => $@
f ($request->{type} eq "message") {
print $fh to_json({status => 1});
my $message = Net::MessageBus::M
Net::MessageBus::Base';
use Net::MessageBus::Message;
use IO::Socket::INET;
use IO::Select;
use JSON;
$| = 1;
=head1 SYNOPSIS
This module implements the client side of the Message Bus.
use N
$/ = "\n";
my $socket = $self->{server_socket};
eval {
print $socket to_json( {type => $type, payload => $object} );
};
if ($@) {
$self->logger->error("M
s/(.*?)\n+// ) {
my $text = $1;
my $data = from_json($text);
if (defined $data->{type} && $data->{type} eq 'message') {
use WWW::Mechanize;
use HTML::TreeBuilder::XPath;
use HTML::Entities;
use JSON;
use DBI;
use Net::FTP;
$VERSION = '0.04' ;
my
sta => $strErro,
);
my $json = \%resposta;
my $json_text = to_json($json, { utf8 => 1 });
print $json_text;
exit;
}
sub erroFTP
{
tp => $ftperror,
);
my $json = \%resposta;
my $json_text = to_json($json, { utf8 => 1 });
return $json_text;
exit;
}
sub
:all/;
use Carp qw/carp croak confess cluck/;
use Data::Dumper;
use Scalar::Util qw/weaken/;
use JSON;
use LWP::UserAgent;
our $VERSION = '0.004';
sub new {
my $class = shift;
my %args = v
params => \%args);
$self->{cookie} = '';
my $decoded = eval { decode_json($response->decoded_content) };
if ($@) {
# probably could not connect at all
$args{user};
return $self;
}
sub logout {
my $self = shift;
my $decoded = decode_json($self->raw_query(method => 'user.logout')->decoded_content);
if ($decoded->{error}) {
..
localhost> .encoding utf-8
localhost> .server xxx
localhost> .reconnect
localhost> .output json
=head1 DESCRIPTION
Redis and Perl share similar data types, therefore I thought it would be use
(and lazily) attempt to log in to the API and get one.
Returns a perl hash representation of the JSON output for L<https://open.ge.tt/1/users/login>.
=back
=cut
around BUILDARGS => sub {
my $o
package WWW::Mixpanel;
use strict;
use warnings;
use LWP::UserAgent;
use MIME::Base64;
use JSON;
BEGIN {
$WWW::Mixpanel::VERSION = '0.04';
}
sub new {
my ( $class, $token, $use_ssl, $api_key, $
unless $token;
my $ua = LWP::UserAgent->new;
$ua->timeout(180);
$ua->env_proxy;
my $json = JSON->new->allow_blessed(1)->convert_blessed(1);
bless { token => $to
data_api => 'mixpanel.com/api/2.0/',
json => $json,
ua => $ua, }, $class;
}
sub track {
Request;
use Plack::Builder;
use Plack::App::Cascade;
use Web::Hippie;
use Web::Hippie::Pipe;
use JSON;
use Carp qw/croak cluck/;
# bus = AnyMQ pubsub client bus
# keep_alive = seconds between "ping"