ict;
use warnings;
our $VERSION = '0.07';
use Moose;
use HTTP::Request;
use LWP::UserAgent;
use JSON;
has 'authen_url' => (
is => 'ro',
isa => 'Str',
required => '1',
default => sub
new;
my $uri = $self->authen_url."?username=$username";
my $json_hash = { value => $password };
my $json = to_json( $json_hash );
my $req = HTTP::Request->new( 'POST', $uri );
$re
sword}
);
$req->header('Accept' => 'application/json');
$req->header('Content-Type' => 'application/json');
$req->content( $json );
my $response = $ua->request( $req );
return
=> 'yes', # check LWP::UA param
},
},
},
script_dirs => [qw(/old/wtscripts /new/json_scripts)],
summary => {
template => "[% CODE_NAME; IF MESSAGES.size > 0 %] - [% MESSA
ERSION = '0.03';
}
use 5.008001;
use strict;
use warnings;
use Moose::Util::TypeConstraints;
use JSON ();
use ZeroMQ::Constants qw(:all);
my %zdcf_socket_types = (
pub => ZMQ_PUB,
sub => ZMQ_SUB
Moose;
use JSON;
use UUID::Tiny ':std';
has 'json' => (is => 'rw', isa => 'JSON');
has 'json_data' => (is => 'rw', isa => 'HashRef[Ref]');
sub BUILD {
my $self = shift;
$self->json(JSON->new->utf
8);
$self->json->convert_blessed(1);
$self->json->allow_blessed(1);
$self->json_data({});
my $v1_mc_UUID = create_uuid();
$self->json_data->{format} = {
id => "b744635a-9d6b-11e3-8ec0-da765d6aa
4db",
multiple => JSON::false,
};
$self->json_data->{result} = {
data => {
network_interfaces => [],
#firewall => {},
#bridges => {},
routes => [],
nameservers => [],
openports
=item C<json>
a JSON encoder object.
=back
=head1 METHODS
=head2 B<init()>
=cut
sub init {
my ($self, %arg_hash) = @_;
my $arg_hash = Eve::Support::arguments(\%arg_hash, my $json);
$self->{'_json'} = $json;
$self->{'_id'} = undef;
$self->SUPER::init(%{$arg_hash});
return;
}
=head2 B<_read()>
This method is called when the graph node or connection is requested
wi
ntent-Type', value => 'text/javascript');
$self->_response->set_body(
text => $self->_json->encode(reference => $reference));
return;
}
=head1 SEE ALSO
=over 4
=item L<Eve::HttpRes
JSON
HTTP::Request
);
my $json = JSON();
my $ua = UserAgent();
my $req = Request( GET => 'http://www.example.com/foo.json' );
my $data = $json->decode
object instantiation in Perl. The example in
the SYNOPSIS creates three functions C<UserAgent>, C<JSON> and <Request> each
of which just pass through their arguments to the real object constructors.
ckage WWW::Jawbone::Up::Score;
use 5.010;
use strict;
use warnings;
use base 'WWW::Jawbone::Up::JSON';
__PACKAGE__->add_subclass(move => 'WWW::Jawbone::Up::Score::Move');
__PACKAGE__->add_subclass
package WWW::KeePassRest;
use 5.006;
use strict;
use warnings FATAL => 'all';
use WWW::JSONAPI;
use File::ShareDir;
use Carp;
=head1 NAME
WWW::KeePassRest - use KeePass for secure local
rest>
KeePassRest exposes a minimal API on localhost:12984, secured by SSL and accessed with a JSON API.
You can't do everything with it (you can't generate passwords, work with groups of entries,
$cert_file" unless -e $key_file;
my $port = $opts{port} || 12984;
$self->{json} = WWW::JSONAPI->new(cert_file => $cert_file,
key_file => $key_f
WW::JSONAPI;
use 5.006;
use strict;
use warnings FATAL => 'all';
use LWP;
use HTTP::Request;
use JSON;
use Carp;
=head1 NAME
WWW::JSONAPI - Very thin and inadequate wrapper for JSON API
;
=head1 SYNOPSIS
This module contains utterly minimal functionality for interacting with JSON-based REST services with or without SSL.
It resulted from my development of L<WWW::KeePassRest>,
and has the purpose of providing a very thin but convenient
abstraction layer on top of LWP and JSON for that API. Other than those, it has no dependencies.
Version 0.01 contains only those methods
ersion numbers so we'll
see how that pans out.
=head1 METHODS
=cut
use Carp;
use DateTime;
use JSON 2.0;
use LWP::UserAgent;
use URI::Escape;
use WWW::Jawbone::Up::Feed;
use WWW::Jawbone::Up::Scor
{ua}->request($request);
croak $response->status_line if $response->is_error;
return decode_json($response->decoded_content);
}
sub __encode {
my ($hash) = @_;
return join '&',
map spr
my $json = $self->_post(
URI_BASE . '/user/signin/login', {
service => 'nudge',
email => $email,
pwd => $password,
});
if ($json->{error}) {
carp $json->{erro
ocket::SSL 1.981
LWP::Protocol::https 6.04
common::sense 3.72
Types::Serialiser 1.0
JSON::XS 3.01
JSON 2.90
Metabase::Client::Simple 0.009
Data::UUID 1.219
Data::GUID 0.048
CPAN::Distn
WWW::Jawbone::Up::Score::Move;
use 5.010;
use strict;
use warnings;
use base 'WWW::Jawbone::Up::JSON';
__PACKAGE__->add_accessors(
qw(distance active_time longest_active longest_idle));
__PACKAGE
f->component );
}
has json => (
is => 'ro',
lazy => 1,
builder => '_build_json',
);
method _build_json() {
eval "use JSON::Any; 1;" or die $@;
return JSON::Any->new;
}
1;
__EN
<Exobrain::Cache> object, with a namespace of
C<$self->component>.
=head2 json
my $json = $self->json;
Returns a L<JSON::Any> object.
=head1 AUTHOR
Paul Fenwick <pjf@cpan.org>
=head1 COPYRIG
sh, l.direction
order by l.language_code
| )->hashes;
$self->render( json => $list );
}
Or:
sub list {
my $self = shift;
my $list = $self->db( 'a
from audio.reciter r
order by r.english
| )->hashes;
$self->render( json => $list );
}
This module uses L<Nour::Database> which is a wrapper for L<DBIx::Simple> to p
ackage WWW::Jawbone::Up::Tick;
use 5.010;
use strict;
use warnings;
use base 'WWW::Jawbone::Up::JSON';
__PACKAGE__->add_accessors(
qw(distance active_time aerobic calories steps time speed));
1;
rd::VERSION = '0.02';
use Moose;
# ABSTRACT: https://pinboard.in/ API client
use HTTP::Tiny;
use JSON::PP;
use URI;
has token => (
is => 'ro',
isa => 'Str',
required => 1,
)
n, format => 'json');
return $uri;
},
);
has ua => (
is => 'ro',
isa => 'HTTP::Tiny',
lazy => 1,
default => sub { HTTP::Tiny->new },
);
has json => (
is
=> 'ro',
isa => 'JSON::PP',
lazy => 1,
default => sub { JSON::PP->new },
);
for my $method (qw(update add delete get recent dates all suggest)) {
__PACKAGE__->meta->add_me
ackage WWW::Jawbone::Up::Feed;
use 5.010;
use strict;
use warnings;
use base 'WWW::Jawbone::Up::JSON';
use DateTime;
__PACKAGE__->add_accessors(
qw(title date type reached_goal), {
timezone
WW::Jawbone::Up::Score::Sleep;
use 5.010;
use strict;
use warnings;
use base 'WWW::Jawbone::Up::JSON';
__PACKAGE__->add_accessors(qw(awakenings light awake time_to_sleep));
sub bedtime {
my $sel
package Exobrain::Foursquare;
use Moose;
use Exobrain::Config;
use JSON::Any;
use Try::Tiny;
use feature qw(say);
# ABSTRACT: Foursquare components for Exobrain
our $VERSION = '0.01'; # VERSION
with
ize->new( autocheck => 1 );
my $json = JSON::Any->new;
$mech->get("$FOURSQUARE_API/checkins/recent?oauth_token=$token&v=20130425");
my $status = $json->decode($mech->content);
if ($
Md2Inao') }) {
if (-d $dir) {
$self->load_filter_config(path($dir, 'id_filter.json'));
last;
}
}
return $self;
}
sub prepend_metadata {
my ($self,