Group
Extension

Matches 35358

MooseX-Role-Flyweight ( S/ST/STEVENL/MooseX-Role-Flyweight-1.03.tar.gz, STEVENL, 2014; MetaCPAN )
MooseX-Role-Flyweight/lib/MooseX/Role/Flyweight.pm ( view source; MetaCPAN )
weight::VERSION = '1.03';

use 5.006;
use JSON 2.00 ();  # works with JSON::XS
use Moose::Role;
use namespace::autoclean;
use Scalar::Util ();

my $JSON = JSON->new->utf8->canonical;

our %INSTANCES;
| ref( $args[0] ) ne 'HASH' )
        ? $class->BUILDARGS(@args)
        : $args[0];

    return $JSON->encode($args);
}

1;

__END__

=pod

=head1 NAME

MooseX::Role::Flyweight - Automatically memoiz
C-sparse ( E/EI/EISELEKD/sparse-decpp/C-sparse-0.07.tar.gz, EISELEKD, 2014; MetaCPAN )
C-sparse/src/sparse-0.4.4/perl/t/include/qapi/qmp/json-streamer.h ( view source; MetaCPAN )
/*
 * JSON streaming support
 *
 * Copyright IBM, Corp. 2009
 *
 * Authors:
 *  Anthony Liguori   <aliguori@us.ibm.com>
 *
 * This work is licensed under the terms of the GNU LGPL, version 2.1 or late


#ifndef QEMU_JSON_STREAMER_H
#define QEMU_JSON_STREAMER_H

#include "qapi/qmp/qlist.h"
#include "qapi/qmp/json-lexer.h"

typedef struct JSONMessageParser
{
    void (*emit)(struct JSONMessageParser 
QList *tokens);
    JSONLexer lexer;
    int brace_count;
    int bracket_count;
    QList *tokens;
    uint64_t token_size;
} JSONMessageParser;

void json_message_parser_init(JSONMessageParser *pars
C-sparse ( E/EI/EISELEKD/sparse-decpp/C-sparse-0.07.tar.gz, EISELEKD, 2014; MetaCPAN )
C-sparse/src/sparse-0.4.4/perl/t/include/qapi/qmp/qerror.h ( view source; MetaCPAN )
as occurred"

#define QERR_JSON_PARSE_ERROR \
    ERROR_CLASS_GENERIC_ERROR, "JSON parse error, %s"

#define QERR_JSON_PARSING \
    ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax"

#define QERR_KVM_
WebService-OMDB ( A/AR/ARJONES/WebService-OMDB-1.140440.tar.gz, ARJONES, 2014; MetaCPAN )
WebService-OMDB/lib/WebService/OMDB.pm ( view source; MetaCPAN )
ERSION = '1.140440';
}

# ABSTRACT: Interface to http://www.omdbapi.com/

use LWP::UserAgent;
use JSON;

use constant BASE_URL => 'http://www.omdbapi.com/';

sub search {
    my ( $s, $options ) = @_;
nse = _get( 's', $s, $options );
    if ( $response->is_success ) {

        my $content = decode_json( $response->content );
        return $content->{Search};
    }
    else {
        die $response-
nse = _get( 'i', $i, $options );
    if ( $response->is_success ) {

        my $content = decode_json( $response->content );
        return $content;
    }
    else {
        die $response->status_li
WWW-NHKProgram-API ( M/MO/MOZNION/WWW-NHKProgram-API-0.03.tar.gz, MOZNION, 2014; MetaCPAN )
WWW-NHKProgram-API/lib/WWW/NHKProgram/API/Provider/Genre.pm ( view source; MetaCPAN )
package WWW::NHKProgram::API::Provider::Genre;
use strict;
use warnings;
use utf8;
use JSON ();
use WWW::NHKProgram::API::Area    qw/fetch_area_id/;
use WWW::NHKProgram::API::Genre   qw/fetch_genre_id
:Provider::Common::call(
        $context,
        "genre/%(area)s/%(service)s/%(genre)s/%(date)s.json",
        {
            area    => $area,
            service => $service,
            genre   =>
 $genre,
            date    => $date,
        },
        $raw,
    );
    return $content if $raw;
    return JSON::decode_json($content)->{list}->{$service};
}

1;

WWW-NHKProgram-API ( M/MO/MOZNION/WWW-NHKProgram-API-0.03.tar.gz, MOZNION, 2014; MetaCPAN )
WWW-NHKProgram-API/lib/WWW/NHKProgram/API/Provider/Now.pm ( view source; MetaCPAN )
package WWW::NHKProgram::API::Provider::Now;
use strict;
use warnings;
use utf8;
use JSON ();
use WWW::NHKProgram::API::Area    qw/fetch_area_id/;
use WWW::NHKProgram::API::Service qw/fetch_service_id
a)s/%(service)s.json",
        {
            area    => $area,
            service => $service,
        },
        $raw,
    );
    return $content if $raw;
    return JSON::decode_json($content)->{no
WWW-NHKProgram-API ( M/MO/MOZNION/WWW-NHKProgram-API-0.03.tar.gz, MOZNION, 2014; MetaCPAN )
WWW-NHKProgram-API/lib/WWW/NHKProgram/API/Provider/Info.pm ( view source; MetaCPAN )
package WWW::NHKProgram::API::Provider::Info;
use strict;
use warnings;
use utf8;
use JSON ();
use WWW::NHKProgram::API::Area    qw/fetch_area_id/;
use WWW::NHKProgram::API::Service qw/fetch_service_i
s.json",
        {
            area    => $area,
            service => $service,
            id      => $id,
        },
        $raw,
    );
    return $content if $raw;
    return JSON::decode_json(
WWW-NHKProgram-API ( M/MO/MOZNION/WWW-NHKProgram-API-0.03.tar.gz, MOZNION, 2014; MetaCPAN )
WWW-NHKProgram-API/lib/WWW/NHKProgram/API.pm ( view source; MetaCPAN )
$client->genre_raw()

=item * $client->info_raw()

=item * $client->now_on_air_raw()

Returns raw JSON response of each API.

=back

=head1 FOR DEVELOPERS

Tests which are calling web API directly in 
WWW-NHKProgram-API ( M/MO/MOZNION/WWW-NHKProgram-API-0.03.tar.gz, MOZNION, 2014; MetaCPAN )
WWW-NHKProgram-API/lib/WWW/NHKProgram/API/Provider/Common.pm ( view source; MetaCPAN )
package WWW::NHKProgram::API::Provider::Common;
use strict;
use warnings;
use utf8;
use Carp;
use JSON ();
use Text::Sprintf::Named qw/named_sprintf/;

use constant API_ENDPOINT => "http://api.nhk.or.
ess) {
        if ($raw) {
            croak $res->{content};
        }
        my $fault = JSON::decode_json($res->{content})->{fault};
        my $fault_str = $fault->{faultstring};
        my $faul
Net-HTTP-Spore-Middleware-Header ( C/CE/CELOGEEK/Net-HTTP-Spore-Middleware-Header-0.03.tar.gz, CELOGEEK, 2014; MetaCPAN )
Net-HTTP-Spore-Middleware-Header/lib/Net/HTTP/Spore/Middleware/Header.pm ( view source; MetaCPAN )
lient = Net::HTTP::Spore->new_from_spec('api.json');
    $client->enable(
        header_name  => 'Content-Type',
        header_value => 'application/json'
    );

=head1 DESCRIPTION

This module is 
App-Office-Contacts ( R/RS/RSAVAGE/App-Office-Contacts-2.04.tgz, RSAVAGE, 2014; MetaCPAN )
App-Office-Contacts/lib/App/Office/Contacts/Controller/AutoComplete.pm ( view source; MetaCPAN )
 strict;
use utf8;
use warnings;
use warnings  qw(FATAL utf8); # Fatalize encoding glitches.

use JSON::XS;

use Try::Tiny;

# We don't use Moo because we isa CGI::Snapp.

our $VERSION = '2.04';

# --
hes: " . scalar @$response);

		# Warning: Do not use ... new -> utf8 -> encode...

		$response = JSON::XS -> new -> encode($response);

		$self -> param('db') -> simple -> commit;
	}
	catch
	{
		my($
log the error despite the error.

		$self -> log(error => "System error: $error");

		$response = JSON::XS -> new -> encode([$self -> param('system_error')]);
	};

	return $response;

} # End of displ
MongoDBx-Class ( I/ID/IDOPEREL/MongoDBx-Class-1.030002.tar.gz, IDOPEREL, 2014; MetaCPAN )
MongoDBx-Class/lib/MongoDBx/Class/Tutorial.pod ( view source; MetaCPAN )
n, and will simply reference the novel with a
'novel' attribute.

=back

Let's look at a possible JSON representation of a novel - "The Valley of
Fear" by Sir Arthur Conan Doyle:

	# in the 'novels' c
atabase (as described in L<MongoDBx::Class/"CAVEATS AND THINGS TO CONSIDER">).
So, looking at the JSON representations from before, we need to modify
the representations like so:

	# in the 'novels' c
Redmine-API ( C/CE/CELOGEEK/Redmine-API-0.04.tar.gz, CELOGEEK, 2014; MetaCPAN )
Redmine-API/lib/Redmine/API/Action.pm ( view source; MetaCPAN )
 to the API
use strict;
use warnings;
our $VERSION = '0.04';    # VERSION
use Moo;

use Carp;
use JSON;
use REST::Client;

has 'request' => (
    is  => 'ro',
    isa => sub {
        croak "request s
_key );
    $cli->addHeader( 'Content-Type'      => 'application/json' );
    $cli->addHeader( 'Accept'            => 'application/json' );
    return $cli;

}

sub create {
    my ( $self, %data ) = 
esponse(
        $self->_rest_cli->POST(
            '/' . $self->request->route . '.json',
            encode_json( { $self->action => \%data } ),
        )
    );
}

sub all {
    my ( $self, %optio
MongoDBx-Class ( I/ID/IDOPEREL/MongoDBx-Class-1.030002.tar.gz, IDOPEREL, 2014; MetaCPAN )
MongoDBx-Class/lib/MongoDBx/Class/Reference.pm ( view source; MetaCPAN )

as defined in L<http://www.mongodb.org/display/DOCS/Database+References>,
for example (this is a JSON example):

	{ "$ref": "collection_name", "$id": ObjectId("4cbca90d3a41e35916720100") }

=cut

wit
Redmine-API ( C/CE/CELOGEEK/Redmine-API-0.04.tar.gz, CELOGEEK, 2014; MetaCPAN )
Redmine-API/lib/Redmine/API.pm ( view source; MetaCPAN )
command will POST to MYREDMINE_SERVER/time_entries.json
    #{time_entry => {issue_id => 3, activity_id => 9, hours => 1, comments => 'test'}} in JSON format
    $c->time_entries->time_entry->create(i
nicate with Redmine thought the REST::Api.

Any result will be a perl HASH, transformation of the json response into a perl HASH.

=head1 NOTES

The Redmine API is not fully complete, and you should u
Finance-Dogecoin ( C/CH/CHROMATIC/Finance-Dogecoin-1.20140201.1608.tar.gz, CHROMATIC, 2014; MetaCPAN )
Finance-Dogecoin/lib/Finance/Dogecoin/API.pm ( view source; MetaCPAN )
warnings-are-a-ticking-time-bomb.html
use warnings NONFATAL => 'all';

use Carp ();

use URI;
use JSON;
use HTTP::Headers;
use LWP::UserAgent;
use LWP::Protocol::https;
use URI::QueryParam;

has 'api_
', is => 'ro', default  => sub { 'https://www.dogeapi.com/wow/' };
has 'json',     is => 'ro', default  => sub {
    my $j = JSON->new; $j->allow_nonref; $j
};

has 'ua',       is => 'ro', default => 
sub {
    my $headers = HTTP::Headers->new;
    $headers->header( 'Content-Type' => 'application/json' );
    LWP::UserAgent->new(
        ssl_opts        => { verify_hostname => 1 },
        default_
Search-OpenSearch-Engine-Xapian ( K/KA/KARMAN/Search-OpenSearch-Engine-Xapian-0.05.tar.gz, KARMAN, 2014; MetaCPAN )
Search-OpenSearch-Engine-Xapian/lib/Search/OpenSearch/Engine/Xapian.pm ( view source; MetaCPAN )
           => 1,                   # include results
    t           => 'XML',               # or JSON
    u           => 'http://yourdomain.foo/opensearch/',
    b           => 'AND',               #
Haineko ( A/AK/AKXLIX/Haineko-0.2.16.tar.gz, AKXLIX, 2014; MetaCPAN )
Haineko/lib/Haineko/HTTPD/Auth.pm ( view source; MetaCPAN )
   return undef unless -f -r -s $passworddb;

        require Haineko::JSON;
        try {
            $credential = Haineko::JSON->loadfile( $passworddb );
        } catch {
            $exceptions =
psgi.

=head1 SYNOPSIS

    use Haineko::HTTPD::Auth;
    use Haineko::JSON;
    $Haineko::HTTPD::Auth::PasswordDB = Haineko::JSON->loadfile('/path/to/password');
    builder {
        enable 'Auth::B
WWW-GoodData ( L/LK/LKUNDRAK/WWW-GoodData-1.11.tar.gz, LKUNDRAK, 2014; MetaCPAN )
WWW-GoodData/lib/WWW/GoodData.pm ( view source; MetaCPAN )
md', { title => 'My Project' });

=head1 DESCRIPTION

B<WWW::GoodData> is the client for GoodData JSON-based API
built atop L<WWW::GoodData::Agent> client agent, with focus
on usefullness and correctn
per funcitons for common actions.

=cut

use strict;
use warnings;

use WWW::GoodData::Agent;
use JSON;
use URI;

our $VERSION = '1.11';
our $root = new URI ('https://secure.gooddata.com/gdc');

=head
 shift;
	my $project = shift;
	my $file = shift;

	# Parse the manifest
	my $upload_info = decode_json (slurp_file ($file));
	die "$file: not a SLI manifest"
		unless $upload_info->{dataSetSLIManifest
Haineko ( A/AK/AKXLIX/Haineko-0.2.16.tar.gz, AKXLIX, 2014; MetaCPAN )
Haineko/lib/Haineko/HTTPD/Response.pm ( view source; MetaCPAN )
 {
    my $class = shift;
    my $ctype = shift || 'plain';
    my $types = {
        'json'  => 'application/json',
        'html'  => 'text/html; charset=utf-8',
        'plain' => 'text/plain; char
);
}

sub json {
    my $self = shift;
    my $code = shift || 200;
    my $data = shift;   # (Ref->[HASH|ARRAY]) or JSON as a string
    my $json = q();

    require Haineko::JSON;
    $json = ref $d
o::JSON->dumpjson( $data ) : $data;
    $self->code( $code );
    return $self->_res( $json, 'json' );
}

sub _res {
    my $self = shift;
    my $text = shift || q();
    my $type = shift || 'json';

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.