Group
Extension

Matches 35359

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-parser.h ( view source; MetaCPAN )
/*
 * JSON Parser 
 *
 * 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 later.
 * See 
 QEMU_JSON_PARSER_H
#define QEMU_JSON_PARSER_H

#include "qemu-common.h"
#include "qapi/qmp/qlist.h"
#include "qapi/error.h"

QObject *json_parser_parse(QList *tokens, va_list *ap);
QObject *json_pars
Groonga-API ( I/IS/ISHIGAKI/Groonga-API-0.03.tar.gz, ISHIGAKI, 2014; MetaCPAN )
Groonga-API/lib/Ploonga.pm ( view source; MetaCPAN )
ct;
use warnings;
use Carp;
use Groonga::API;
use Groonga::API::Constants qw/GRN_CTX_USE_QL/;
use JSON::XS ();
no bytes;

use constant DEFAULT_PORT => 10041;

our $VERSION = $Groonga::API::VERSION;

s
x, $host, $port, 0);
    croak "failed to connect to $host:$port ($rc)" if $rc;
  }

  $args{_json} = JSON::XS->new->utf8($args{encoding} ? 1 : 0);

  bless \%args, $class;
}

sub do {
  my ($self, @a
 ($self->{encoding}) {
    $res = Encode::decode($self->{encoding}, $res);
  }

  eval { $self->{_json}->decode($res) } || $res;
}

sub ctx { shift->{_ctx} }
sub db  { shift->{_db} }

sub DESTROY {
  
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
Module-Advisor ( T/TO/TOKUHIROM/Module-Advisor-0.17.tar.gz, TOKUHIROM, 2014; MetaCPAN )
Module-Advisor/lib/Module/Advisor.pm ( view source; MetaCPAN )
83357'],
    ['Plack::Middleware::AxsLog' => '== 0.20', 'Missing \n'],
);

our @XS = (
    ['JSON' => 'JSON::XS'],
    # ['PPI' => 'PPI::XS'], # I think PPI::XS is outdated.
    ['Plack' => 'HTTP::Par
S, ['Filesys::Notify::Simple', 'Linux::Inotify2'];
}

our @FEATURE = (
    ['Amon2' => '< 3.29', 'JSON hijacking detection.'],
    ['Log::Minimal' => '< 0.10', 'LM_COLOR'],
    ['Log::Minimal' => '< 0
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/qjson.h ( view source; MetaCPAN )
/*
 * QObject JSON integration
 *
 * 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 la
ry.
 *
 */

#ifndef QJSON_H
#define QJSON_H

#include <stdarg.h>
#include "qemu/compiler.h"
#include "qapi/qmp/qobject.h"
#include "qapi/qmp/qstring.h"

QObject *qobject_from_json(const char *string) 
QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2);
QObject *qobject_from_jsonv(const char *string, va_list *ap) GCC_FMT_ATTR(1, 0);

QString *qobject_to_json(const QObject *obj);
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_
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/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
WWW-NHKProgram-API ( M/MO/MOZNION/WWW-NHKProgram-API-0.03.tar.gz, MOZNION, 2014; MetaCPAN )
WWW-NHKProgram-API/lib/WWW/NHKProgram/API/Provider/List.pm ( view source; MetaCPAN )
package WWW::NHKProgram::API::Provider::List;
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
.json",
        {
            area    => $area,
            service => $service,
            date    => $date,
        },
        $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 
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
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
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
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',               #
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(
WebService-SyoboiCalendar ( H/HA/HAKOBE/WebService-SyoboiCalendar-0.02.tar.gz, HAKOBE, 2014; MetaCPAN )
WebService-SyoboiCalendar/lib/WebService/SyoboiCalendar/API.pm ( view source; MetaCPAN )
use JSON::XS;
use Web::Query;

use WebService::SyoboiCalendar::Error;
use WebService::SyoboiCalendar::API::Search;

Readonly my $API_RSS2  => "http://cal.syoboi.jp/rss2.php";
Readonly my $API_JSON  =>
 "http://cal.syoboi.jp/json.php";
Readonly my $API_LOGIN => "http://cal.syoboi.jp/usr";

has ua => (
    is => 'ro',
    default => sub { 
        my $ua = LWP::UserAgent->new;
        $ua->cookie_jar
s->is_error;
    $res;
}

sub get_json {
    my ($self, $url, $args) = @_;
    my $res = $self->get($url, $args);
    my $json = decode_json($res->content);
    $json;
}

sub _param {
    args_pos my 
Positron ( B/BD/BDEUTSCH/Positron-v0.1.3.tar.gz, BDEUTSCH, 2014; MetaCPAN )
Positron/lib/Positron/DataTemplate.pm ( view source; MetaCPAN )
se case, however, the output was needed in
JSON format, not HTML. One solution would have been to use the text-based
templating system to produce a valid JSON document (quite risky). The other solutio
in code, and use a JSON serializer on that, bypassing the template
output.

The third solution would have been to provide a template that did not directly
produce the serialised JSON text, but describ
orking only with structured data, and never with text,
the serialized output must always be valid JSON.

This (minus the serialization) is the domain of C<Positron::DataTemplate>.

=head1 EXAMPLES

Th

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