ead1 VERSION
version 1.03
=head1 SYNOPSIS
$json_storage = $json_format->wrap($storage);
$json_storage->write({ a => "b" });
$in = $json_storage->in("client1");
$data = $in->read();
package Geo::Coder::Mapquest;
use strict;
use warnings;
use Carp qw(croak);
use Encode ();
use JSON;
use LWP::UserAgent;
use URI;
use URI::Escape qw(uri_unescape);
our $VERSION = '0.06';
$VERSION =
f the response from 'application/json' so
# HTTP::Message will decode the character encoding.
$res->content_type('text/plain');
my $data = eval { from_json($res->decoded_content) };
r
f the response from 'application/json' so
# HTTP::Message will decode the character encoding.
$res->content_type('text/plain');
my $data = eval { from_json($res->decoded_content) };
r
api for sending SMS
use HTTP::Request::Common;
use HTTP::Request;
use WWW::Mechanize::GZip;
use JSON::XS;
use MIME::Base64;
use Moo;
has 'consumer_key' => ( is => 'rw', predicate => 1, required =>
_type => 'client_credentials']);
if($res->code == 200) {
my $json = decode_json($res->content);
$self->access_token($json->{'access_token'});
}
}
{
my $retries = 0;
sub query {
m
ation/json");
$ua->default_header('Authorization', "Bearer " . $self->access_token);
my $req = HTTP::Request->new( $request_method, $url );
if ($data) {
my $json = encode_json($dat
package Catmandu::Fix::cmd;
use namespace::clean;
use Catmandu::Sane;
use IO::Pty::Easy;
use JSON::XS;
use Moo;
=head1 NAME
Catmandu::Fix::cmd - pipe data to be fixed through an external process
=
$VERSION = '0.0201';
=head1 DESCRIPTION
This fix passes data as a JSON object to an external process over stdin and
reads a JSON object from it's stdout.
=head1 SYNOPSIS
my $fixer = Catmandu:
jq command-line json processor
# keeping only the title field
'cmd("jq -c -M {title}")',
# ...
]);
# a canonical external program in perl
use JSON;
while (<ST
abs/;
use Furl;
use Getopt::Long qw/:config posix_default no_ignore_case bundling auto_help/;
use JSON;
use Module::CoreList;
use Term::ANSIColor qw/colored/;
our $VERSION = "0.02";
$ENV{ANSI_COLORS
);
my $res = $furl->post(
METACPAN_API_URL,
[ 'Content-Type' => 'application/json' ],
sprintf( <<'EOQ', $module_name, $version_dscr ) );
{
"query": {
{ %s }
]
}
}
EOQ
my $content = decode_json( $res->{content} );
my @deps = @{$content->{hits}->{hits}[0]->{fields}->{dependency}};
ose;
use namespace::autoclean;
extends 'Hubot::Adapter';
use AnyEvent::MyPeopleBot::Client;
use JSON::XS;
use Encode 'decode_utf8';
use Hubot::Message;
has httpd => (
is => 'ro',
l
name};
$self->client->profile(
$buddyId,
sub {
my $data = decode_json(shift);
$user->{name} = $data->{buddys}[0]{name};
$cb->($user);
}
oups ) {
$self->client->exit(
$groupId,
sub {
my $json = shift;
return if $self->count_groups != ++$exit;
$self->httpd-
ct returned by the GPSD daemon.
An example JSON object:
=head1 METHODS PROPERTIES
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Return the parent Ne
n;
use Data::Dumper;
use LWP::UserAgent;
use LWP::Protocol::https;
use HTTP::Request::Common;
use JSON;
use Data::Printer;
use URI::Escape;
use File::Util qw(SL);
use Encode qw(is_utf8 _utf8_off);
use
. '/buddy/send.json';
our $API_BUDDY = $API_BASE . '/profile/buddy.json';
our $API_GROUP_MEMBERS = $API_BASE . '/group/members.json';
our $API_GROUP_SEND = $API_BASE . '/group/send.json';
our $API_GRO
UP_EXIT = $API_BASE . '/group/exit.json';
our $API_FILE_DOWNLOAD = $API_BASE . '/file/download.json';
our $API_SEND_LENGTH = 1000;
sub BUILD {
my $self = shift;
}
sub _call_file {
my $self = shif
TION
Provides a Perl object interface to the SKY object returned by the GPSD daemon.
An example JSON object:
=head3 Protcol 3.1 versions
{
"class":"SKY",
"tag":"MID4",
"device":"/dev
}
=head1 METHODS PROPERTIES
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Return the parent Net::GPSD object
=head2 device
=cut
sub device {shift
rict;
use warnings;
use utf8;
use Mouse;
use Mouse::Util::TypeConstraints;
use YAML::Tiny ();
use JSON ();
use List::MoreUtils qw/any/;
use Log::Minimal;
use File::Basename;
use File::Temp;
use Path::
infof("retrieve meta data");
if ( my ($json) = grep /META.json$/, @files ) {
my $data = $json->slurp;
JSON::decode_json($data);
}
elsif ( my ($yml) = g
s ) {
eval{
# json format yaml
my $data = $yml->slurp;
YAML::Tiny::Load($data) || JSON::decode_json($data);
};
}
self = shift;
my $api = PGXN::API->instance;
my $tmpl = $api->read_json_from(catfile $api->mirror_root, 'index.json');
return { map { $_ => URI::Template->new($tmpl->{$_}) } keys %{ $tmpl
=~ /\s>f(?:[+]+|(?:c|.s|..t)[^ ]+)\sindex[.]json$/) {
# Always update the index JSON if it's mentioned.
$indexer->update_root_json;
}
elsif ($line =~ $user_re)
n {
my ($self, $fn) = shift->_rel_to_mirror(@_);
my $meta = PGXN::API->instance->read_json_from($fn);
my $zip_path = $self->download_for($meta);
# Validate it against the SHA1 che
GPSD daemon.
=head1 METHODS
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Return the parent L<Net::GPSD3> object
=head2 enabled
=cut
sub enabled
le (deprecated)
=cut
sub enable {shift->enabled(@_)}; #bad protocol name
=head2 json
=cut
sub json {shift->{"json"}};
=head2 nmea
=cut
sub nmea {shift->{"nmea"}};
=head2 raw
=cut
sub raw {s
SD daemon.
An example JSON string:
{"PRN":15,"el":77,"az":123,"ss":0, "used":false},
=head1 METHODS
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Random Number Identifier
=cut
sub PRN {shift->{"PRN"}};
*prn=\&PRN;
=head2 used
Returns a L<JSON::XS::Boolean> true or false object.
=cut
sub used {shift->{"used"}};
=head2 az, azimuth
Retur
package Net::GPSD3;
use strict;
use warnings;
use base qw{Net::GPSD3::Base};
use JSON::XS qw{};
use IO::Socket::INET6 qw{};
use Net::GPSD3::Return::Unknown;
use Net::GPSD3::Cache;
use DateTime
ACKAGE__;
=head1 NAME
Net::GPSD3 - Interface to the gpsd server daemon protocol versions 3 (JSON).
=head1 SYNOPSIS
=head2 Watch Interface
use Net::GPSD3;
my $gpsd=Net::GPSD3->new;
an open source GPS daemon from http://www.catb.org/gpsd/ Support for Version 3 of the protocol (JSON) was added to the daemon in version 2.90. If your daemon is before 2.90 (protocol 2.X), please u
GPSD daemon.
=head1 METHODS
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Return the parent L<Net::GPSD3> object
=head2 release
=cut
sub release
eption
register_exception('ProfileInvalidFormat',
message_pattern => "Unknown format use yml, json or pl: %s"
);
my $dfv;
my $results;
register form_validator_error => sub {
$results =
ile;
my $available_deserializer = {
json => sub {
my ( $file ) = @_;
load JSON::Syck;
my $data = JSON::Syck::LoadFile($file);
return $dat
- name
- subject
- body
msgs:
missing: Not here
Example with json format:
{
"profile_contact": {
"required": [
"name",
utf8;
use MooseX::Singleton;
use File::Spec::Functions qw(catfile catdir);
use URI::Template;
use JSON;
use namespace::autoclean;
our $VERSION = v0.16.3;
=head1 Name
PGXN::API - Maintain and serve a
ks for distributing any kind of release distributions and for
providing a lightweight static file JSON REST API.
PGXN::API provides a superset of the static file REST API, embellishing the
metadata i
=> 1, default => sub {
my $self = shift;
my $tmpl = $self->read_json_from(
catfile $self->doc_root, 'index.json'
);
return { map { $_ => URI::Template->new($tmpl->{$_}) } keys
/im.kayac.com";
use AnyEvent::HTTP;
use HTTP::Request::Common;
use Digest::SHA qw/sha1_hex/;
use JSON;
use Carp;
=head1 NAME
AnyEvent::WebService::ImKayac - connection wrapper for im.kayac.com
=he
cb => sub {
my ($hdr, $json, $reason) = @_;
if ( $json ) {
if ( $json->{result} eq "posted" ) {
}
else {
warn $json->{error};
}
dy, $hdr) = @_;
local $@;
my $json = eval { decode_json($body) };
if ( $hdr->{Status} =~ /^2/ ) {
$cb->( $hdr, $json, $@ ? "parse error: $@" : $hdr->{Reason} );
}
=head1 METHODS PROPERTIES
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Returns the parent L<Net::GPSD3> object
=head2 device
=cut
sub device {
GPSD daemon.
=head1 METHODS
=head2 class
Returns the object class
=head2 string
Returns the JSON string
=head2 parent
Return the parent Net::GPSD object
=head2 devices
Returns a list of devi