:NonMoose 0.20;
use CouchDB::Client 0.09 qw ();
use Catalyst::Exception;
use Catalyst::Utils;
use JSON 2.17 qw ();
use Try::Tiny 0.09;
use namespace::autoclean;
extends 'Catalyst::Authentication::Us
for_session {
my ($self) = @_;
my $data = $self->_user->contentForSubmit();
# Return JSON here, because it's fast, it's human readable so we can
# see what's going on in the session.
is mangling it.
return JSON::encode_json($data);
}
sub from_session {
my ($self, $frozen_user) = @_;
$self->_user($self->_user_doc_from_hash(JSON::decode_json($frozen_user)));
retur
n Timestamp JSONMap
JSONBoolean Retvals List Dimension ReferenceType
NotificationFormat )
];
use MooseX::Types::Moose qw(Int Str ArrayRef HashRef Any);
use DateTimeX::Easy;
use JSON::Any;
subt
'must be a valid date' };
subtype JSONMap,
as Str,
where { eval { ref( JSON::Any->new(utf8 => 1)->from_json($_) ) eq 'HASH'} },
message { 'must be a valid JSON map of key/value pairs' };
subty
{ 'Must be "source", "category", or "location"'};
subtype JSONBoolean,
as Str,
where {/^true|false$/ },
message { 'Must contain a json boolean: "true" or "false"' };
subtype NotificationFormat
RSION = '0.002';
}
# ABSTRACT: A simple means of receiving GitHub's web hooks
use Try::Tiny;
use JSON;
has routes => (
is => 'rw',
predicate => 'has_routes',
required => 1,
i
my $json = decode_json $payload;
# callback
$self->routes->{ "/$path" }->( $json );
}
catch {
# malformed JSON string, n
ect, number, string or atom, at character offset 0 ?
# you are trying to POST non JSON data. don't do that.
warn "Caught exception: /$path: attempted to trigger callbac
eX::Params::Validate;
use URI;
use LWP::UserAgent;
use JSON::Any;
use WWW::3Taps::API::Types qw( Source Category Location Timestamp JSONMap
JSONBoolean Retvals List Dimension ReferenceType Notificat
}
);
has _json_handler => (
is => 'rw',
default => sub { JSON::Any->new( utf8 => 1, allow_nonref => 1 ) },
handles => {
_from_json => 'from_json',
_to_json => 'to_json'
},
);
execTimeMs => 325,
# numResults => 141087,
# success => bless( do { \( my $o = 1 ) }, 'JSON::XS::Boolean' )
# results => [
# {
# category => "VAUT",
# externalU
package WebService::Vtiger;
use warnings;
use strict;
use LWP::UserAgent;
use JSON;
use Digest::MD5;
=head1 NAME
Webservice::Vtiger - Interface to vtiger5.2 webservices
=head1 VERSION
Version 0
ibutes:
=over 2
=item * ua: the browser
Instance of LWP::UserAgent
=item * json: the json handler
Instance of JSON
=item * ctx: the MD5 handler
Instance of Digest::MD5
=item * url: the url o
my $self = {
'ua' => LWP::UserAgent->new, # browser
'json' => JSON->new->allow_nonref, # json handler
'ctx' => Digest::MD5->new, # MD5 handler
'
...
=head1 SUBROUTINES/METHODS
=head2 extract_license
Returns license code for META.yml/json from perl/pod text by matching several patterns.
=head2 extract_perl_version
Returns perl v
ZMQ_POLLIN
ZMQ_PULL
ZMQ_PUB
ZMQ_IDENTITY
ZMQ_RCVMORE
ZMQ_LINGER
);
use JSON qw(decode_json);
use HTTP::Status qw(status_message);
use Plack::Util ();
use Plack::Util::Accessor
my %hdrs;
if (DEBUG()) {
print STDERR "[Mongrel2.pm] Decoding JSON '$headers'\n";
}
return decode_json $headers;
}
sub _parse_pattern {
my $pattern = shift;
if (DEBUG())
y) = _parse_netstring($rest);
if ( $env{REQUEST_METHOD} eq 'JSON' ) {
my $json_body = decode_json $body;
if ($json_body->{type} eq 'disconnect') {
# noop
} el
$Net::Disqus::Interfaces::VERSION = '1.19';
}
# this got turned into a module since bundling a json file is often
# a pain in the you-know-whatsit - plus I forgot to add it to the Dist::Zilla
# dis
['json','jsonp'],'required' => ['group'],'method' => 'GET'},'list' => {'formats' => ['json','jsonp'],'required' => ['forum'],'method' => 'GET'}},'applications' => {'listUsage' => {'formats' => ['json'
jsonp'],'required' => [],'method' => 'GET'}},'categories' => {'listPosts' => {'formats' => ['json','jsonp','rss'],'required' => ['category'],'method' => 'GET'},'details' => {'formats' => ['json','json
= $self->fragment;
my %args = (@_);
$self->fragment(undef);
my $url = sprintf('%s%s.json', $self->api_url, $self->path);
my $method = lc($fragment->{method});
my $required = $fra
my ($json, $rate) = $self->ua->request($method, $url, %args);
die Net::Disqus::Exception->new({ code => $json->{code}, text => $json->{response}}) if(!$self->pass_api_errors && $json->{code}
'X-Ratelimit-Remaining'});
$self->rate_limit_reset($rate->{'X-Ratelimit-Reset'});
return $json;
}
sub AUTOLOAD {
my $self = shift;
my $fragment = ((($_ = $AUTOLOAD) =~ s/.*://) ? $_ :
package WWW::MediaTemple;
use Carp qw(croak);
use JSON;
use XML::Simple;
use base qw(REST::Client);
our $VERSION = 0.02;
sub new {
my ( $class, %args ) = @_;
if ( !$args{api_key} ) { croa
api/v1',
pretty_print => 'true',
wrap_root => 'true',
format => 'json',
raw_data => '',
key => ''
);
# we prefer the following ve
}
sub addService {
my ( $self, %args ) = @_;
my $b_content = undef;
# prepare xml/json
if ( $self->{format} eq 'xml' ) {
$b_content = "<service><serviceType>$args{serviceTy
/bin/env perl
package IO::Multiplex::Intermediary;
our $VERSION = "0.06";
use MooseX::POE;
use JSON;
use List::MoreUtils qw(any);
use Scalar::Util qw(reftype);
use POE qw(
Wheel::SocketFactory
my $json = eval { from_json($input) };
{
if ($@ || !$json) {
warn "JSON error: $@";
}
elsif (!exists $json->{param}) {
warn "Invalid JSON struct
last unless $json->{data}->{id};
last unless reftype($self->rw_set);
last unless $self->rw_set->{ $json->{data}->{id} };
if ($json->{param} eq 'output')
&bar=2"
R('Profile', 'larry') # "/~larry"
R('Profile', 'larry', 'json') # "/~larry.json"
As you can see, C<@ar
n('wolowitz');
...
}
=head1 DESCRIPTION
L<Locale::Wolowitz> is a i18n tool that use JSON as its lexicon
storage. This Mojolicious plugin is an alternative choice to do i18n
in Mojolicio
ome, and then put translation files into there. See
L<Locale::Wolowitz> for the content format of JSON files.
=head1 METHODS
=head2 loc($message, @args)
Return the localized C<$message>. The target
use namespace::autoclean;
use IO::Socket;
use IO::Select;
use Time::HiRes qw(gettimeofday);
use JSON;
local $| = 1;
has socket => (
is => 'rw',
isa => 'IO::Socket::INET',
@inputs = grep { $_ } split /\e/m, $input;
for (@inputs) {
my $output = $self->parse_json($_);
$self->socket->send("$output\n\e");
}
};
sub build_response {
my $self
ift;
my $data = shift;
return to_json({param => 'null'});
}
sub input_hook {
my $self = shift;
my $data = shift;
return to_json(
{
param => 'output',
IO::File;
use JSON::XS;
use Data::Dumper;
my $interfaces;
my $fh = IO::File->new('./interfaces.json');
{
local $/;
$interfaces = <$fh>;
}
$fh->close();
my $json = decode_json($interfaces);
my $out = IO::File->new('>../lib/Net/Disqus/Interfaces.pm');
while(<$fh>) {
$out->print($_);
}
$fh->close();
$out->print('sub INTERFACES { return ', Dumper($json), "; }\n\n1;\n");
$out->close();
$Net::Disqus::VERSION";
if(!$args{'forcelwp'}) {
eval 'use Mojo::UserAgent; use Mojo::JSON; use Mojo::URL';
unless($@) {
$args{'ua_class'} = 'Mojo::UserAgent';
gent; use JSON::PP; use URI; use URI::Escape;';
die Net::Disqus::Exception->new({code => 500, text => 'Something really funny is going on, cannot find one of LWP::UserAgent, JSON::PP, URI,
rAgent; use JSON::PP; use URI; use URI::Escape;';
die Net::Disqus::Exception->new({code => 500, text => 'Something really funny is going on, cannot find one of LWP::UserAgent, JSON::PP, URI, U
e 5.001;
use strict;
use warnings;
use HTTP::Cookies;
use HTTP::Response;
use LWP::UserAgent;
use JSON;
use utf8;
use vars qw($VERSION $errstr);
binmode STDOUT, ":utf8";
binmode STDERR, ":utf8";
###
ass = shift;
my $self = { @_ };
($self->{user}, $self->{pass}) = (shift, shift);
$self->{json} = new JSON;
if (!$self->{user} || !$self->{pass}){
$WWW::Geni::errstr = "Username and password are
rl) = (shift, shift);
my $res = $self->{ua}->get($url);
if ($res->is_success){
return $self->{json}->allow_nonref->relaxed->decode($res->decoded_content);
} else {
$WWW::Geni::errstr = $res->st
ditable set of fields. Issuance result holds in the JSON
=head2 EXPORT
new();
get(id); # return full data page (all fields) in JSON
get(id,key); # return a single field with a ke
y;
use base qw(Project::Easy);
has 'id', default => 'caramba';
has 'conf_format', default => 'json';
my $class = __PACKAGE__;
has 'entity_prefix', default => join '::', $class, 'Entity', '';
use.
=item B<< META2_NAME >>
The string that should be used for this license in the CPAN F<META.json>
or F<META.yml> file, according to the CPAN Meta spec v2. Leave out
if there is no known string