= '0.001';
}
use MooseX::App::Command;
use 5.010;
use POSIX qw(strftime);
use HTTP::Request;
use JSON;
use TryCatch;
use WebService::Amazon::Glacier::GlacierError;
extends qw(WebService::Amazon::Glac
ault update method
=cut
sub update{
my $self = shift;
return $self->render(status => 405, json => {message => 'You can only update your own profile!!!'} )
if ( !defined $self->param('id')
as Perl itself.
package Authen::SASL::Perl::XOAUTH2 2.1900;
use strict;
use vars qw(@ISA);
use JSON::PP;
@ISA = qw(Authen::SASL::Perl);
my %secflags = (
noanonymous => 1,
);
sub _order {
rn $auth_string
}
sub client_step {
my ($self, $challenge) = @_;
my $json = JSON::PP->new;
my $payload = $json->decode( $challenge );
$self->set_error( $payload );
# Send dummy re
SION = '0.008';
}
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::JSON;
use Mojo::Util;
use DateTime;
use DBIx::Class::ResultClass::HashRefInflator;
use Lingua::EN::In
>resultset( $self->{resource} )
->create( $self->{_payload} );
return $self->render_json( $result->{_column_data} );
}
sub update{
my $self = shift;
my $result_rs = $self->app->m
::Class::ResultClass::HashRefInflator');
my @result = $result_rs->all();
return $self->render_json( @result );
}
sub list{
my $self = shift;
my $result = $self->app->model
->result
(getcwd);
use File::Basename;
use Gearman::Client;
use Rex::TaskList::Base;
use Rex::Logger;
use JSON::XS;
use base qw(Rex::TaskList::Base);
sub new {
my $that = shift;
my $proto = ref($that)
to execute $task_name on $server->to_s");
$taskset->add_task(
$func_name => encode_json($options), {
on_complete => sub {
Rex::Logger::info("Successfully exec
';
use JSON;
use AnyEvent::HTTP;
use AnyEvent::CouchDB::Exceptions;
use Data::Dump::Streamer;
use URI::Escape qw( uri_escape uri_escape_utf8 );
use IO::All;
use MIME::Base64;
our $default_json;
# ma
:cvcb;
*default_json = *AnyEvent::CouchDB::default_json;
*_build_headers = *AnyEvent::CouchDB::_build_headers;
our $query = sub {
my $options = shift;
my $json = $default_json;
my @buf;
$name eq 'startkey' || $name eq 'endkey') {
$value = ref($value)
? uri_escape($json->encode($value))
: (defined $value)
? uri_escape_utf8(qq{"$value"})
b Command Tools
use Carp;
use Moose;
use Net::GitHub;
use Term::ReadKey;
use Term::ReadLine;
use JSON::XS;
use IPC::Cmd qw/can_run/;
our $VERSION = '1.0.1';
has 'term' => (
is => 'rw',
c2(@args);
# o.blob return plain text
if ( ref $result ) {
$result = JSON::XS->new->utf8->pretty->encode($result);
}
$self->print($result);
};
if
$conf{content_type} = "application/rdf+xml";
} elsif ( $args{format} eq "json" ) {
$template = "json_index.tt";
$conf{content_type} = "text/javascript";
} elsif
$guide->show_metadata(type => "category");
$guide->show_metadata(type => "category", format => "json");
Lists all metadata types, or all metadata values of a given
type. Useful for programatically
if($args{"format"}) {
if($args{"format"} eq "json") {
$content_type = "text/javascript";
my $json = OpenGuides::JSON->new( wiki => $wiki,
package AnyEvent::CouchDB;
use strict;
use warnings;
our $VERSION = '1.30';
use JSON;
use AnyEvent::HTTP;
use AnyEvent::CouchDB::Database;
use AnyEvent::CouchDB::Exceptions;
use URI;
use URI::Escape
"AnyEvent::CouchDB::Exception::HTTPError";
our $JSONError = "AnyEvent::CouchDB::Exception::JSONError";
# default JSON encoder
our $default_json = JSON->new->utf8;
# arbitrary uri support
sub _build
}
elsif ( !exists $headers->{'Content-Type'} ) {
$headers->{'Content-Type'} = 'application/json';
}
if ( exists $self->{http_auth} ) {
$headers->{'Authorization'} = $self->{http_auth};
=head1 DESCRIPTION
Clustericious::Config reads configuration files which are Mojo::Template's
of JSON or YAML files. There should generally be an entry for
'url', which may be used by either a clien
ding on
how this node in the cluster is being used.
After rendering the template and parsing the JSON, the resulting
object may be called using method calls or treated as hashes.
Config files are lo
re may be overridden.
YAML config files must begin with "---", otherwise they are interpreted
as JSON.
Clustericious::Config provides a "get_password" function which will prompt
for a password if it
t::CouchDB::Stream;
use strict;
use warnings;
use URI;
use AnyEvent::HTTP;
use Scalar::Util;
use JSON;
use Try::Tiny;
use MIME::Base64;
our $VERSION = '0.02';
sub new {
my $class = shift
sub { };
my $headers = delete $args{headers}
|| { 'Content-Type' => 'application/json' };
my $include_docs = delete $args{include_docs};
my $uri = URI->new($server);
$uri
e, $json ) = @_;
$set_timeout->();
if ($json) {
try {
$on_change->(JSON::decode_json($json));
model = RDF::Trine::Model->temporary_model;
my $content_type_mapping = {
'application/json' => sub {$self->export_to_hash(%opts)},
'application/rdf+xml' => sub {$self->export_to_st
ders', 'body' ],
},
'AnyEvent::CouchDB::Exception::JSONError' => {
isa => 'AnyEvent::CouchDB::Exception',
description => 'JSON decoding error',
},
'AnyEvent::CouchDB::Exception
# handle an HTTP error
}
when (ref eq 'AnyEvent::CouchDB::Exception::JSONError') {
# handle a JSON decoding error
}
default {
$_->show_trace(1);
warn "$_";
chDB::Exception for HTTP errors
=item AnyEvent::CouchDB::Exception::JSONError
A subclass of AnyEvent::CouchDB::Exception for JSON decoding errors
=back
=head1 API
This module provides the follow
package Net::GoogleDrive;
use common::sense;
use JSON;
use Mouse;
use LWP::UserAgent;
use HTTP::Request::Common;
use URI;
=head1 NAME
Net::GoogleDrive - A Google Drive API interface
=head1 VERSION
->ua();
my $res = $ua->request($req);
if ($res->is_success()) {
my $token = JSON::from_json($res->content());
$self->access_token($token->{access_token});
print "Got
nt wrong: ".$res->status_line();
}
}
=head2 files
This returns a files Resource object from JSON.
=cut
sub files
{
my $self = shift;
my $req = HTTP::Request->new(
GET => 'http
-sapObj} = SAPserver->new();
}
else
{
use JSON::XS;
open(CONTIGS,"<$g") || die "$g is not a file that can be opened";
my $json = JSON::XS->new;
my $input_genome;
local $/;
undef $/;
my $input_genome_txt = <CONTIGS>;
$input_genome = $json->decode($input_genome_txt);
my $tmp = $input_genome->{contigs};
my @raw_contigs = map { [$_->{id},'',$_->{dna
JSON::RPC::Client;
use strict;
use Data::Dumper;
use URI;
=head1 NAME
Bio::KBase::IDServer::Client
=head1 DESCRIPTION
=cut
sub new
{
my($class, $url) = @_;
my $self = {
client => JSON
package Bio::KBase::CDMI::Client;
use JSON::RPC::Client;
use strict;
use Data::Dumper;
use URI;
use Bio::KBase::Exceptions;
=head1 NAME
Bio::KBase::CDMI::Client
=head1 DESCRIPTION
=cut
sub new
rams => \@args,
});
if ($result) {
if ($result->is_error) {
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
code => $result->content->{code},
rams => \@args,
});
if ($result) {
if ($result->is_error) {
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
code => $result->content->{code},
ebHooks::Event::Call::Failure';
use aliased 'Message::Passing::WebHooks::Event::Bad';
use JSON qw/ encode_json /;
use namespace::autoclean;
our $VERSION = '0.007';
$VERSION = eval $VERSION;
with 'Me
_json($data->{data});
# XXX FIXME http://wiki.shopify.com/Verifying_Webhooks
# HMAC goes here.
#warn "MAKE POST to " . $data->{url};
my $headers = { 'Content-Type' => 'application/json
POST /test HTTP/1.1
Host: localhost:5000
Content-Length: 13
Content-Type: application/json
{"foo":"bar"}
# Consume messages from ZeroMQ, and publish results to
# ZeroMQ:
pod
=head3 C<to_json($data)>
Returns the JSON representation of C<$data> (arbitrary
datastructure -- but not objects). See http://www.json.org/ or
http://en.wikipedia.org/wiki/JSON for details. In
to_json {
my $self = shift;
my $data = shift;
return 'null' unless defined $data;
my $type = reftype($data);
unless (defined($type)) {
return $self->_escape_json_str
n(',', map { $self->to_json($_) } @$data) . ']';
}
elsif ($type eq 'HASH') {
my @keys = sort keys %$data;
return '{' . join(',', map { $self->_escape_json_str($_) . ':'
se Log::Dispatch;
use Log::Dispatch::Message::Passing;
use Message::Passing::Filter::Encoder::JSON;
use Message::Passing::Output::ZeroMQ;
my $log = Log::Dispatch->new;
$log->add(Log::Dispa
egate_log',
min_level => 'debug',
output => Message::Passing::Filter::Encoder::JSON->new(
output_to => Message::Passing::Output::ZeroMQ->new(
connect =>