Brightcove::MAPI;
# ABSTRACT: Brightcove Media API Wrapper
our $VERSION = '0.1';
use URI;
use JSON;
use Any::Moose;
use LWP::UserAgent;
has read_api_url => (
is => 'rw',
required=> 1,
default
s);
my $res = $self->user_agent->get($url->as_string);
if ($res->is_success) {
return decode_json($res->decoded_content);
} else {
confess $res->status_line;
}
}
sub post {
my $self = shif
t;
my $params = shift || {};
my $file = shift;
$params->{token} = $self->token;
my $jsonrpc = encode_json({
method => $method,
params => $params,
});
my $res;
if (defined($file) and -f $
ks for distributing any kind of release distributions and for
providing a lightweight static file JSON REST API.
This module provides a simple PGXN web site. All it needs is a
L<PGXN::API>-powered AP
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
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
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
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
: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
...
=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
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',
$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
= $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/.*://) ? $_ :
te with the Disqus API
pass_api_errors (optional) When set, any API errors are returned as a JSON object instead of
throwing an exception.
=head1 METHODS/HELPERS
$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
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
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')
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();
&bar=2"
R('Profile', 'larry') # "/~larry"
R('Profile', 'larry', 'json') # "/~larry.json"
As you can see, C<@ar
chosen as the serialization
format since YAML is well suited as a human editable format; however, JSON
support is planned). This module provides an API for usage by Perl applications.
Main database f
of the document. Quite frankly, Giddy will not care if the files
are in fact binary. They can be JSON or plain text files for all it cares, but as
long as they are separate from attributes.yaml, they
A document file (implies '_body' attribute holds HTML data)
data.json <-- A document file (implies '_body' attribute holds JSON text)
about/ <-- A document directory
attributes.yaml
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