ames>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Net::TribalWarsMap::API::TribeLookup::Result",
"interface":"class",
"inherits":"Moo::Object"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent
);
has 'decoder' => (
is => 'ro',
lazy => 1,
builder => sub {
require JSON;
return JSON->new();
},
);
has 'world' => (
is => ro =>,
required => 1,
);
has search
...
my $ua = $instance->ua();
=head2 C<decoder>
The C<JSON> Decoder object
my $instance = $class->new(
decoder => JSON->new()
);
=head2 C<world>
B<MANDATORY PARAMETER>:
$instance = $class->new( _ts => "mm-dd-yyy" );
=head2 C<_results>
Lazy builder that returns a C<json>-decoded version of the result of fetching C<uri>.
my $instance = $class->new( _results => {
her::WWO;
use Moo;
use MooX::Types::MooseLike::Base qw/Str Int HashRef Bool/;
use HTTP::Tiny;
use JSON;
our $VERSION = '0.07';
=head1 Name
Weather::WWO - API to World Weather Online
=head1 Synopsi
default => sub { 5 },
);
# We are only using the JSON format
has 'format' => (
is => 'ro',
isa => Str,
default => sub { 'json' },
init_arg => undef,
);
has 'temperature_
ponse->{content};
die "No content for $URL\n" unless defined $content;
my $data = decode_json($content);
# Are there any errors?
if (my $errors = $data->{data}->{error}) {
for
type);
}
sub is_binary {
my $mime_type = shift;
$mime_type !~ /\b(?:text|xml|javascript|json)\b/;
}
sub last_modified {
my $self = shift;
$self->{last_modified} ||= do {
my
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
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
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);
};
}
);
}
sub update_root_json {
my $self = shift;
my $api = PGXN::API->instance;
say "Updating mirror root JSON" if $self->verbose;
# Augment and write index.json.
my $src = catfil
e $api->mirror_root, 'index.json';
my $dst = catfile $api->doc_root, 'index.json';
my $tmpl = $api->read_json_from($src);
$tmpl->{source} = "/src/{dist}/{dist}-{version}/";
$tmpl->{
}/';
$tmpl->{userlist} = '/users/{letter}.json';
($tmpl->{htmldoc} = $tmpl->{meta}) =~ s{/META[.]json$}{/{+docpath}.html};
$api->write_json_to($dst, $tmpl);
return $self;
}
sub cop
::App::File;
use Plack::App::Directory;
use PGXN::API::Searcher;
use List::MoreUtils qw(any);
use JSON;
use Plack::Request;
use Encode;
use File::Spec::Functions qw(catdir);
use namespace::autoclean;
enable 'HTTPExceptions';
enable 'StackTrace', no_print_errors => 1;
enable 'JSONP', callback_key => 'callback';
enable sub {
my $app = shift;
sub
val && $val !~ /^\d+$/;
}
# Give 'em the results.
my $json = encode_json $searcher->search(
in => $in,
query => decode_utf8($q
/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} );
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
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}};
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
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
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
}
=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 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
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 device
Name the device for
pedClient->new("https://apis.daum.net/mypeople/profile/buddy.json?apikey=" . $self->apikey);
$client->header('Accept', 'application/json')
->post(
{ buddyId => $buddyId },
pedClient->new("https://apis.daum.net/mypeople/group/members.json?apikey=" . $self->apikey);
$client->header('Accept', 'application/json')
->post(
{ groupId => $groupId },
copedClient->new("https://apis.daum.net/mypeople/$which/send.json?apikey=" . $self->apikey);
$client->header('Accept', 'application/json')
->post(
\%params,
sub {
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-