ngs;
use MooseX::Method::Signatures;
use Moose;
use WebService::Beeminder::Types qw(BeeBool);
use JSON::Any;
use LWP::UserAgent;
use Carp qw(croak);
our $VERSION = '0.002'; # VERSION: Generated by DZ
ult => 'https://www.beeminder.com/api/v1');
# Everything needs to be able to read/write JSON.
my $json = JSON::Any->new;
sub BUILD {
my ($self) = @_;
# Make sure we have a user-agent, if n
,"$user.json"]);
}
# Gets the datapoints for a goal
# DONE: 2011-11-25. This takes no parameters.
method datapoints(Str $goal) {
return $self->_userget( ['goals', $goal, 'datapoints.json']);
}
esponse;
use Any::Moose;
use WebService::Solr::Document;
use Data::Page;
use Data::Pageset;
use JSON::XS ();
has 'raw_response' => (
is => 'ro',
isa => 'Object',
handles => {
>raw_response->content;
return {} unless $content;
my $rv = eval { JSON::XS::decode_json( $content ) };
### JSON::XS throw an exception, but kills most of the content
### in the diagn
m * raw_response - the raw L<HTTP::Response> object.
=item * content - a hashref of deserialized JSON data from the response.
=item * docs - an array of L<WebService::Solr::Document> objects.
=item
oder::Google::V2;
use strict;
use warnings;
our $VERSION = '0.11_02';
use Carp;
use Encode;
use JSON;
use HTTP::Request;
use LWP::UserAgent;
use URI;
sub new {
my($class, %param) = @_;
my
URI->new("http://$self->{host}/maps/geo");
my %query_parameters = (q => $location, output => 'json');
$query_parameters{hl} = $self->{language} if defined $self->{language};
$query_paramet
croak("Google Maps API returned error: " . $res->status_line);
}
my $json = JSON->new->utf8;
my $data = $json->decode($res->content);
my @placemark = @{ $data->{Placemark} || [] };
perly numify the numbers
# before and after them being futzed with, because some of
# the JSON engines are stupid/annoying/frustrating
'Int' => { expand => sub { $_[0] + 0 }, collapse
=> 'ro',
isa => 'HashRef',
auto_deref => 1,
default => sub { { wt => 'json' } }
);
has 'last_response' => (
is => 'rw',
isa => 'Maybe[WebService::Solr::Response]'
{
$options->{ default_params }
= { %{ $options->{ default_params } }, wt => 'json', };
}
return $options;
}
sub add {
my ( $self, $doc, $params ) = @_;
my @docs
Point;
use Moose;
use MooseX::Storage;
our $VERSION = '0.01';
with Storage('format' => 'JSON', 'io' => 'File');
has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'In
zation format
## (in this case JSON)
# pack the class into a JSON string
$p->freeze(); # { "__CLASS__" : "Point-0.01", "x" : 10, "y" : 10 }
# unpack the JSON string into a class
my $p2 = P
methods to load/store a class
## on the file system
$p->store('my_point.json');
my $p2 = Point->load('my_point.json');
=head1 DESCRIPTION
MooseX::Storage is a serialization framework for Moo
t::TLS;
require bytes;
use Carp qw(croak);
use Encode;
use Scalar::Util 'looks_like_number';
use JSON::Any;
our $VERSION = '0.10';
has certificate => (
is => 'rw',
isa => 'Str |
clearer => 'clear_handler',
);
has json_driver => (
is => 'rw',
isa => 'Object',
lazy => 1,
default => sub {
JSON::Any->new( utf8 => 1 );
},
);
has on_
sub send {
my $self = shift;
my ($token, $payload, $expiry) = @_;
my $json = encode_utf8( $self->json_driver->encode($payload) );
# http://developer.apple.com/library/ios/#DOCUMENT
oder::Google::V3;
use strict;
use warnings;
our $VERSION = '0.11_02';
use Carp;
use Encode;
use JSON;
use HTTP::Request;
use LWP::UserAgent;
use URI;
sub new {
my($class, %param) = @_;
my
ode::encode_utf8($location);
}
my $uri = URI->new("http://$self->{host}/maps/api/geocode/json");
my %query_parameters = (address => $location);
$query_parameters{language} = $self->{l
croak("Google Maps API returned error: " . $res->status_line);
}
my $json = JSON->new->utf8;
my $data = $json->decode($res->content);
if ($data->{status} eq 'OVER_QUERY_LIMIT') {
}
# ABSTRACT: Interface for a Google Storage Object
# https://developers.google.com/storage/docs/json_api/v1/objects#resource
use Moose;
use Net::Google::Storage::Types;
has id => (
is => 'ro',
toring the data of an object, slightly cut down from
L<https://developers.google.com/storage/docs/json_api/v1/objects#resource>.
Generally Net::Google::Storage::Object objects are acquired from a
C<g
formation about the file itself - check out the
L<docs|https://developers.google.com/storage/docs/json_api/v1/objects#resource>.
=head2 contentEncoding
The content encoding of the object's data.
=h
p->evaluate_move_attempt($attempt);
return $result;
}
sub scorable{ #new? args? scorable_from_json?
my $self = shift;
my $scorable = Games::Go::Cinderblock::Scorable->new(
state => $se
_POSINT _HASH _HASHLIKE};
use JSON;
our $VERSION = '1.02';
sub new {
my ($class, $args) = @_;
my $self = bless($args, $class);
$self->{format} = 'json';
if ( $self->{secure} ==
;
}
sub decode {
my $self = shift;
my $json = JSON->new->allow_nonref;
if ( length $_[0] == 0 ) {
return {};
}
else {
return $json->decode( $_[0] );
}
}
sub account_system
uest = @_;
my $json_request = encode_json \%request;
my $results;
$self->{client}->POST($self->{protocol}.$self->{realm}."/api/v3/clients.".$self->{format}, $json_request);
$re
dumper => sub { Convert::Bencode_XS::bencode($_[0]) }
# or maybe
use JSON::PC;
dumper => sub { JSON::PC::convert($_[0]) }
=item B<connect>
This option is only useful if you want
easy Authy API
use MooX qw(
+LWP::UserAgent
+HTTP::Request::Common
+URI
+URI::QueryParam
+JSON
);
use Carp qw( croak );
our $VERSION ||= '0.000';
has api_key => (
is => 'ro',
required =
'has_useragent_timeout',
);
has json => (
is => 'ro',
lazy => 1,
builder => 1,
);
sub _build_json {
my $json = JSON->new;
$json->allow_nonref;
return $json;
}
##############################
};
}
sub make_url {
my ( $self, @args ) = @_;
my $url = join('/',$self->base_uri,'protected','json',@args);
my $uri = URI->new($url);
$uri->query_param( api_key => $self->api_key );
return $uri
guments that could be used to initialize an identical delta.
B<Rulemap not included.>
Useful for JSON serialization.
=head1 TODO
=head2 time!
If states are given a timestamp, it would be <prudent
Plugin::ExtJS::VERSION = '1.000001';
}
# ABSTRACT: Convert paginated DBIx::Class::ResultSet's to JSON-style structures
use strict;
use warnings;
require Exporter;
use Scalar::Util 'blessed';
use b
xt_paginate {
my $self = shift;
my $resultset = shift;
my $method = shift || 'TO_JSON';
return $self->ext_parcel(
[map { blessed($_) ? $_->$method : $_ } $resultset->all],
ass::ResultSet's to JSON-style structures
=head1 VERSION
version 1.000001
=head1 SYNOPSIS
use CGI::Application::Plugin::ExtJS ':all';
sub people {
# ...
my $json = $self->ext_pagina
HTML::FormHandler and JQuery Validator
=head1 VERSION
0.05
=cut
our $VERSION = '0.05';
use JSON;
use URI::Escape;
use Moose::Role;
=head1 SYNOPSIS
use HTML::FormHandler::Moose;
with HTML:
input type="hidden" id="validation_json" value="[% form.as_escaped_json %]">
<script>
var validationJSON = JSON.parse(decodeURIComponent($("#validation_json").val() ) );
$("#story_form")
tionJSON.rules,
highlight: function(label) {
$(label).closest('.control-group').addClass('error');
},
messages: validationJSON.me
}
# ABSTRACT: Interface for a Google Storage Bucket
# https://developers.google.com/storage/docs/json_api/v1/buckets#resource
use Moose;
use Net::Google::Storage::Types;
has id => (
is => 'ro',
storing the data of a bucket, slightly cut down from
L<https://developers.google.com/storage/docs/json_api/v1/buckets#resource>.
Generally Net::Google::Storage::Bucket objects are acquired from a
C<g
f of the owner details for the bucket - see
L<the docs|https://developers.google.com/storage/docs/json_api/v1/buckets#resource>.
=head2 location
Physical location of the servers containing this buck
earch;
use MooseX::Attribute::Deflator;
use MooseX::Attribute::Deflator::Moose;
use DateTime;
use JSON;
use Scalar::Util qw(blessed);
use MooseX::Types::ElasticSearch qw(:all);
use MooseX::Types -dec
ode_json($_) }, inline_as {
return '$value' if ( $_[0]->dynamic );
return 'JSON::encode_json($value)';
};
inflate [ 'ArrayRef', 'HashRef' ],
via { shift->dynamic ? $_ : decode_json($_)
}, inline_as {
return '$value' if ( $_[0]->dynamic );
return 'JSON::decode_json($value)';
};
deflate 'ArrayRef', via {$_}, inline_as {'$value'};
inflate 'ArrayRef', via {$_}, inline_as {
BSTRACT: Access the Google Storage JSON API (currently experimental).
# https://developers.google.com/storage/docs/json_api/
use Moose;
use LWP::UserAgent;
use JSON;
use HTTP::Status qw(:constants);
d=$projectId");
die 'Failed to list buckets' unless $res->is_success;
my $response = decode_json($res->decoded_content);
my @buckets = map {Net::Google::Storage::Bucket->new($_)} @{$response-
OUND;
die "Failed to get bucket: $bucket_name" unless $res->is_success;
my $response = decode_json($res->decoded_content);
return Net::Google::Storage::Bucket->new($response);
}
sub insert_bu
el::Document::Role::VERSION = '0.1.4';
}
use Moose::Role;
use ElasticSearchX::Model::Util ();
use JSON;
use Digest::SHA1;
use List::MoreUtils ();
use Carp;
sub _does_elasticsearchx_model_document_rol