API
$WWW::Pusher::Client::VERSION = '0.04';
use strict;
use warnings;
use 5.010_001;
use Moo;
use JSON;
use Carp;
use AnyEvent::WebSocket::Client;
use Digest::SHA qw(hmac_sha256_hex);
has 'auth_key'
my $body = from_json($message->decoded_body);
if ($body->{event} eq 'pusher:connection_established') {
$self->_socket_id(from_json($body->{data})->{socket_id}
my $data = $self->_construct_private_auth_data($channel);
return $self->ws_conn->send(to_json({
event => 'pusher:subscribe',
data => $data
}));
}
sub _construct_private_a
rict;
use warnings;
use bignum;
use base 'Salvation::AnyNotify::Plugin::Graphite::Monitor';
use JSON ();
use Salvation::Method::Signatures;
use constant {
POINT_IDX_TIME => 1,
POINT_IDX_VA
if( scalar( @warnings ) > 0 ) {
my $bus = $core -> bus();
my $json = JSON
-> new()
-> allow_blessed()
-> al
foreach my $warning ( @warnings ) {
$bus -> notify( $warning -> { 'type' }, $json -> encode( $warning ) );
}
}
}
};
}
1;
__END__
FILES
There are currently 3 distributions to test META files:
Test-CPAN-Meta
Test-CPAN-Meta-JSON
Test-CPAN-Meta-YAML
All three have slightly different requirements and are intended to be used
s.
Test-CPAN-Meta-JSON is the most recent addition to the family, and is specifically
aimed at those distributions that use a META.json Meta file. The distribution
requires the JSON module to parse t
d1 DESCRIPTION
Net::PMP::CollectionDoc::Permission represents a special link in a Collection.doc+JSON PMP API response.
See L<https://github.com/publicmediaplatform/pmpdocs/wiki/Permissions-Design>.
set, will be output as a scalar
reference to an integer, so that passing to encode_json() will create a proper JSON boolean.
=head1 AUTHOR
Peter Karman, C<< <karman at cpan.org> >>
=head1 BUGS
Pl
P::CLI;
use Moose;
with 'MooseX::SimpleConfig';
with 'MooseX::Getopt';
use Net::PMP::Client;
use JSON;
use Data::Dump qw( dump );
our $VERSION = '0.006';
has '+configfile' =>
( default => $ENV{
ag --tag foo
get --path /path/to/resource
groups
put --file /path/to/resource.json
users
EOF
return $txt;
}
sub _list_items {
my ( $self, $label, $urn ) = @_;
my $
client->last_response->status_line );
}
else {
#dump $doc;
print $doc->as_json;
}
}
=head2 put([I<filename>])
Reads I<filename> and PUTs it to the server. If missing, the
package Net::Airbrake::Request;
use strict;
use warnings;
use JSON qw(encode_json);
use Class::Tiny qw(errors context environment session params);
sub BUILDARGS {
my $class = shift;
my ($pa
$param->{$member}{$key} =~ s/./*/g;
}
}
$param;
}
sub to_json {
my $self = shift;
encode_json({
notifier => {
name => "Net-Airbrake/$Net::Airbra
ION
Handles pulling in symbol-related data versioned by date.
=cut
use Net::SSL;
use JSON qw(to_json from_json);
use List::Util qw(min max);
use Moose::Role;
use Carp;
use URL::Encode qw(:all);
use
se Net::PMP::CollectionDoc::Links;
use Net::PMP::CollectionDoc::Items;
use UUID::Tiny ':std';
use JSON;
use Try::Tiny;
our $VERSION = '0.006';
# the 'required' flag on these attributes should match
'ro', isa => 'ArrayRef', required => 0, );
=head1 NAME
Net::PMP::CollectionDoc - Collection.doc+JSON object for Net::PMP::Client
=head1 SYNOPSIS
my $doc = $pmp_client->get_doc();
printf("API ver
sents the PMP API media type L<https://github.com/publicmediaplatform/pmpdocs/wiki/Collection.doc-JSON-Media-Type>.
=head1 METHODS
=head2 href
The unique identifier. See L<http://cdoc.io/spec.html#
e . Defaults to C</test>.
=item lib_dir
By default the plugin uses a version of Jasmine and its JSON reporter bundled
in its share folder. If you prefer to use your own version of
Jasmine, you can
PhantomJS, we could use:
use strict;
use warnings;
use Test::More;
use JSON qw/ from_json /;
use Test::TCP;
use WWW::Mechanize::PhantomJS;
use Dancer::Plugin::Test::J
$mech->get("http://localhost:$port?test=verify_title");
jasmine_results from_json
$mech->eval_in_page('jasmine.getJSReportAsString()';
},
server =
use autodie qw( open close chmod rename );
use Data::Dumper;
use Storable qw(thaw nfreeze);
use JSON;
use Carp;
use Lock::File 1.01 qw(lockfile);
my %defaults = (
read_only => 0,
auto_comm
rmat} eq 'auto';
} elsif ($str =~ /^{/) {
$self = JSON->new->decode($str);
$_self->{format} = 'json' if $_self->{format} eq 'auto';
}
else {
t} = 'storable' if $_self->{format} eq 'auto';
}
} else {
$_self->{format} = 'json' if $_self->{format} eq 'auto'; # default format for new files
$self = {};
}
ble
WP::UserAgent 6; # SSL verification bug fixed in 6.03
use HTTP::Request;
use MIME::Base64;
use JSON;
use Net::PMP::AuthToken;
use Net::PMP::CollectionDoc;
use Net::PMP::Schema;
use Net::PMP::Creden
(
is => 'rw',
isa => 'Str',
default => sub {'application/vnd.collection.doc+json'},
);
has 'last_response' => ( is => 'rw', isa => 'HTTP::Response', );
# TODO add strict mode wh
a
A LWP::UserAgent object.
=item pmp_content_type
Defaults to C<application/vnd.collection.doc+json>. Change at your peril.
=back
=head2 BUILD
Internal method for object construction.
=head2 la
age Net::Airbrake;
use strict;
use warnings;
our $VERSION = '0.02';
use HTTP::Tiny;
use JSON qw(decode_json);
use Scope::Guard qw(guard);
use Net::Airbrake::Request;
use Net::Airbrake::Error;
use
elf->_ua->request(POST => $self->_url, {
content => $req->to_json,
headers => { 'Content-Type' => 'application/json' },
});
die "Request failed to Airbrake: @{[$res->{status}]}
@{[$res->{reason}]} (@{[$res->{content}]})"
unless $res->{success};
decode_json($res->{content});
}
sub notify {
my $self = shift;
my ($error, $option) = @_;
$self->add_err
ref);
}
=head1 DESCRIPTION
Net::PMP::CollectionDoc::Link represents a link in a Collection.doc+JSON PMP API response.
=head1 METHODS
=head2 hints
=head2 href
=head2 title
=head2 rels
=head2 v
;
}
=head1 DESCRIPTION
Net::PMP::CollectionDoc::Links represents the links in a Collection.doc+JSON PMP API response.
=head1 METHODS
=head2 links
Returns arrayref of links.
=head2 type
The fla
package MojoX::AlmostJSON;
$MojoX::AlmostJSON::VERSION = '1.151250';
# ABSTRACT: Almost JSON but allow javascript function
# Code stolen from Mojo::JSON
use Mojo::Base -strict;
use B;
use Carp 'croa
ed';
our @EXPORT_OK = qw(decode_json encode_json false from_json j to_json true);
# Booleans
my ($FALSE, $TRUE) = map { bless \(my $dummy = $_), 'MojoX::AlmostJSON::_Bool' } 0, 1;
# Escaped spec
$_} //= sprintf '\u%.4X', $_ }
sub decode_json {
my $err = _decode(\my $value, shift);
return defined $err ? croak $err : $value;
}
sub encode_json { Mojo::Util::encode 'UTF-8', _encode_value
ebService::UrbanDictionary> objects upon successfully retreiving data from UrbanDictionary.com's
JSON API.
=head2 Methods
=over 12
=item C<< definition >>
Returns either an array of hashes contai
# ABSTRACT: An OO interface to UrbanDictionary.com's JSON API.
our $VERSION = "2.015";
use Carp;
use strict;
use warnings;
use Moo;
use JSON;
use LWP::UserAgent;
use WebService::UrbanDictionary::
= shift or carp "No term provided.";
my $url = $self->_end_point_url . $term;
my $res = decode_json $self->_ua->get( $url )->decoded_content or carp "Error during fetch/decode.";
$res->{term} = $t
_END__
=pod
=head1 NAME
WebService::UrbanDictionary - An OO interface to UrbanDictionary.com's JSON API.
=head1 VERSION
version 2.015
=head1 SYNOPSIS
use WebService::UrbanDictionary;
my $ud
file extension, the value is the MIME type to send.
my %type_override = (
'json' => 'application/json; charset=UTF-8',
'htc' => 'text/x-component',
);
return ($type_overr
TS = (
ttl => 'Turtle',
nt => 'NTriples',
n3 => 'Notation3',
json => 'RDFJSON',
rdfxml => 'RDFXML'
);
has base_dir => (
is => 'ro', required => 1,
isa =>
zation format (See L<Plack::Middleware::Negotiate>). Supported
values are C<ttl>, C<nt>, C<n3>, C<json>, and C<rdfxml>.
=back
If an existing resource does not contain triples, the axiomatic triple
C
:Dispatcher -base;
use Jifty::YAML ();
use Jifty::JSON ();
use Data::Dumper ();
use XML::Simple;
use URI::Escape ();
before qr{^ (/=/ .*) \. (js|json|yml|yaml|perl|pl|xml|html) $}x => run {
Jifty
ts:
JSON, JS, YAML, XML, Perl, and HTML
and may be requested in such formats by sending an appropriate HTTP Accept: header
or appending one of the extensions to any resource:
.json, .js, .y
rns the user's desired output format. Returns a hashref of:
format: JSON, JS, YAML, XML, Perl, or HTML
extension: json, js, yml, xml, pl, or html
content_type: text/x-yaml; charset=UTF-8,