Group
Extension

Matches 35358

JSON-RPC-Simple ( C/CL/CLAESJAC/JSON-RPC-Simple-0.05.tar.gz, CLAESJAC, 2012; MetaCPAN )
JSON-RPC-Simple/lib/JSON/RPC/Simple/Client.pm ( view source; MetaCPAN )
package JSON::RPC::Simple::Client;

use strict;
use warnings;

use Carp qw(croak);
use LWP::UserAgent;
use JSON qw();
use URI::Escape qw();

require JSON::RPC::Simple;

use constant DEFAULT_TIMEOUT =>
 180;
use constant JSON_RPC_HTTP_HEADERS => (
    Content_Type        => "application/json; charset=UTF-8",
    Accept              => 'application/json',
);

sub new {
    my ($pkg, $uri, $attrs) = @
$attrs eq "HASH";
    
    my $agent = delete $attrs->{agent} || "JSON::RPC::Simple " . 
                                          JSON::RPC::Simple->VERSION;
                                        
YellowBot-API ( A/AB/ABH/YellowBot-API-0.96.tar.gz, ABH, 2012; MetaCPAN )
YellowBot-API/lib/YellowBot/API/Request/JSON.pm ( view source; MetaCPAN )
package YellowBot::API::Request::JSON;
{
  $YellowBot::API::Request::JSON::VERSION = '0.96';
}

use Moose;

use HTTP::Request;
use JSON qw(encode_json);

use namespace::clean -except => 'meta';

exten
lf->_more_args;

    # JSON POST request
    my $req = HTTP::Request->new('POST', $uri, ['Content-Type' => 'application/json; charset=utf-8']);
    my $req_content = encode_json(\%extra);
    $req->co
ing utf8

=head1 NAME

YellowBot::API::Request::Json - Request object for YellowBot::API (JSON POST)

=head1 SYNOPSIS

This class manages setting up JSON POST requests for the YellowBot::API.

No user
JSON-RPC-Simple ( C/CL/CLAESJAC/JSON-RPC-Simple-0.05.tar.gz, CLAESJAC, 2012; MetaCPAN )
JSON-RPC-Simple/lib/JSON/RPC/Simple/Dispatcher.pm ( view source; MetaCPAN )
package JSON::RPC::Simple::Dispatcher;

use strict;
use warnings;

use Carp qw(croak);
use HTTP::Response;
use JSON qw();

sub new {
    my ($pkg, $args) = @_;

    $args = {} unless ref $args eq "HAS
",
        json => JSON->new->utf8,
        error_handler => undef,
        %$args,
        target => {} 
    }, $pkg;
    return $self;
}

sub json {
    my $self = shift;
    $self->{json} = shift i
f @_;
    return $self->{json};
}

sub error_handler {
    my $self = shift;
    $self->{error_handler} = shift if @_;
    return $self->{error_handler};    
}

sub charset {
    my $self = shift;
   
JSON-RPC-Simple ( C/CL/CLAESJAC/JSON-RPC-Simple-0.05.tar.gz, CLAESJAC, 2012; MetaCPAN )
JSON-RPC-Simple/lib/JSON/RPC/Simple.pm ( view source; MetaCPAN )
package JSON::RPC::Simple;

use strict;
use warnings;

use Scalar::Util qw(blessed refaddr);
use Carp qw(croak);

our $VERSION = '0.05';

our $ClientClass = "JSON::RPC::Simple::Client";
sub connect {
kg = shift;

    require JSON::RPC::Simple::Client;
    
    my $self = $ClientClass->new(@_);
    return $self;
}

sub dispatch_to {
    my $pkg = shift;
    
    require JSON::RPC::Simple::Dispatche
  return $method_attributes{refaddr $code};
    }

    my $method_attr_re = qr{
        ^
        JSONRpcMethod
        (?:\(\)|\(
            \s*
            (\w+ (\s*,\s* \w+)*)?
            \s*
   
Grimlock ( D/DH/DHOSS/Grimlock-0.11.tar.gz, DHOSS, 2012; MetaCPAN )
Grimlock/lib/Grimlock/Web/View/JSON.pm ( view source; MetaCPAN )
ge Grimlock::Web::View::JSON;
{
  $Grimlock::Web::View::JSON::VERSION = '0.11';
}

use strict;
use base 'Catalyst::View::JSON';
use JSON::XS ();
use Try::Tiny;

sub encode_json {
    my($self, $c, $da
ta) = @_;
    my $encoder = JSON::XS->new->ascii->allow_nonref->convert_blessed->allow_blessed;
    $encoder->pretty if $c->debug;
    my $d = $encoder->encode($data);
    return $d;
}
 
sub process {
lf->encode_json($c, $data); 
    return $serialized;
}


=head1 NAME

Grimlock::Web::View::JSON - Catalyst JSON View

=head1 SYNOPSIS

See L<Grimlock::Web>

=head1 DESCRIPTION

Catalyst JSON View.

=h
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/JSON.pm ( view source; MetaCPAN )
package Net::Fluidinfo::JSON;
use Moose;

use JSON::XS;

has json => (
    is      => 'ro',
    isa     => 'JSON::XS',
    default => sub { JSON::XS->new->utf8->allow_nonref },
    handles => [qw(enco
Badger ( A/AB/ABW/Badger-0.09.tar.gz, ABW, 2012; MetaCPAN )
Badger/lib/Badger/Codec/JSON.pm ( view source; MetaCPAN )
#========================================================================
#
# Badger::Codec::JSON
#
# DESCRIPTION
#   Codec module for encoding/decoding Base64
#
# AUTHOR
#   Andy Wardley   <abw@wardl
ge Badger::Codec::JSON;

use Badger::Class
    version => 0.01,
    base    => 'Badger::Codec',
    import  => 'class',
    codecs  => 'utf8';

eval "require JSON::XS";
our $HAS_JSON_XS = $@ ? 0 : 1;

eval "require JSON";
our $HAS_JSON = $@ ? 0 : 1;
our $MODULE = 
    $HAS_JSON_XS ? 'JSON::XS' :
    $HAS_JSON    ? 'JSON'     :
    die "No JSON implementation installed\n";

# TODO: figure out if it
XML-XML2JSON ( K/KE/KEN/XML-XML2JSON-0.06.tar.gz, KEN, 2012; MetaCPAN )
XML-XML2JSON/lib/XML/XML2JSON.pm ( view source; MetaCPAN )
package XML::XML2JSON;
use strict;
our $VERSION = '0.06';

use Carp;
use XML::LibXML;

our $XMLPARSER ||= XML::LibXML->new();

=head1 NAME

XML::XML2JSON - Convert XML into JSON (and back again) using
2JSON;
	
	my $XML = '<test><element foo="bar"/></test>';
	
	my $XML2JSON = XML::XML2JSON->new();
	
	my $JSON = $XML2JSON->convert($XML);
	
	print $JSON;
	
	my $RestoredXML = $XML2JSON->json2xml($JSON)
sed Google for inspiration: http://code.google.com/apis/gdata/json.html

In short:

=over 4

=item * The response is represented as a JSON object; each nested element or attribute is represented as a 
Web-App ( A/AP/APLA/Web-App-1.21.tar.gz, APLA, 2012; MetaCPAN )
Web-App/lib/Web/App/Presenter/JSON.pm ( view source; MetaCPAN )
package Web::App::Presenter::JSON;
# $Id: JSON.pm,v 1.5 2009/03/29 10:08:42 apla Exp $

use Class::Easy;

use JSON;

use Web::App::Presenter;
use base qw(Web::App::Presenter);

1;

sub headers {
	my $
ontent-Type' => 'text/plain; charset=utf-8');
	# $headers->header ('Content-Type' => 'application/json');
	$headers->header ('Cache-Control' => 'no-store');
	# $headers->header ('Expires' => localtime
y $json = JSON->new;
	$json->allow_blessed (1);
	$json->convert_blessed (1);
	$json->pretty (1);
	$json->space_before (0);
	$json->space_after (0);
	
	my $json_text;
	
	my $t = timer ('dumping json');
MARC-Utils-MARC2MARC_in_JSON ( B/BB/BBAXTER/MARC-Utils-MARC2MARC_in_JSON-0.05.tar.gz, BBAXTER, 2011; MetaCPAN )
MARC-Utils-MARC2MARC_in_JSON/lib/MARC/Utils/MARC2MARC_in_JSON.pm ( view source; MetaCPAN )
_JSON;

use 5.008002;
use strict;
use warnings;
use Carp;

our $VERSION = '0.05';

our (@ISA, @EXPORT_OK);
BEGIN {
    require Exporter;
    @ISA = qw(Exporter);
    @EXPORT_OK = qw( marc2marc_in_json
 marc_in_json2marc each_record );
}

use MARC::Record;
use JSON;  # decode_json()

#---------------------------------------------------------------------
sub marc2marc_in_json {
    my( $marc_record )
 = @_;

    my %marc_in_json;

    for my $leader ( $marc_record->leader() ) {
        $marc_in_json{'leader'} = $leader;
    }

    for my $field ( $marc_record->fields() ) {

        my $ftag = $fie
App-Mimosa ( L/LE/LETO/App-Mimosa-0.02.tar.gz, LETO, 2011; MetaCPAN )
App-Mimosa/lib/App/Mimosa/Controller/JSON.pm ( view source; MetaCPAN )
package App::Mimosa::Controller::JSON;
use Moose;
use Bio::Chado::Schema;
use File::Spec::Functions;
use Set::Scalar;
use Digest::SHA1 'sha1_hex';
use App::Mimosa::Util qw/slurp/;

use namespace::auto
json',
    stash_key => 'rest',
    'map' => {
        # Work around an ExtJS bug that sends the wrong content-type
        'text/html'        => 'JSON',
    }

);

sub grid_json :Path("/api/grid/json
.json") :ActionClass('REST') :Local { }

# Answer GET requests to the above Path
sub grid_json_GET {
    my ( $self, $c ) = @_;

    my $data = _grid_json_data($c);
    # Return a 200 OK, with the dat
Lucy ( D/DW/DWHEELER/Lucy-0.2.2.tar.gz, DWHEELER, 2011; MetaCPAN )
Lucy/lib/Lucy.pm ( view source; MetaCPAN )
til::Json;
    use Scalar::Util qw( blessed );
    use Lucy qw( to_clownfish );
    use Lucy::Util::StringHelper qw( utf8_valid utf8_flag_on );
    use JSON::XS qw();

    my $json_encoder = JSON::XS-
_json {
        my ( undef, %args ) = @_;
        my $result;
        my $instream = $args{folder}->open_in( $args{path} )
            or return;
        my $len = $instream->length;
        my $json;
      $instream->read( $json, $len );
        if ( utf8_valid($json) ) {
            utf8_flag_on($json);
            $result = eval { to_clownfish( $json_encoder->decode($json) ) };
        }
       
Lucy ( D/DW/DWHEELER/Lucy-0.2.2.tar.gz, DWHEELER, 2011; MetaCPAN )
Lucy/lib/Lucy/Util/Json.pm ( view source; MetaCPAN )
IONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package Lucy::Util::Json;
use Lucy;

1;

__END__


Data-Encoder ( X/XA/XAICRON/Data-Encoder-0.05.tar.gz, XAICRON, 2011; MetaCPAN )
Data-Encoder/lib/Data/Encoder/JSON.pm ( view source; MetaCPAN )
a::Encoder::JSON;

use strict;
use warnings;
use JSON;

sub new {
    my ($class, $args) = @_;
    my $json = JSON->new;

    $args ||= {};
    for my $method (keys %$args) {
        $json->$method(de
  json => $json,
    }, __PACKAGE__;
}

sub encode {
    my ($self, $stuff, @args) = @_;
    $self->{json}->encode($stuff, @args);
}

sub decode {
    my ($self, $stuff, @args) = @_;
    $self->{json}
rds

=head1 NAME

Data::Encoder::JSON - Data::Encoder gateway for JSON

=head1 SYNOPSIS

  use Data::Encoder;
  
  my $encoder = Data::Encoder->load('JSON');
  my $json = $encoder->encode([qw/foo bar/
Silki ( D/DR/DROLSKY/Silki-0.29.tar.gz, DROLSKY, 2011; MetaCPAN )
Silki/lib/Silki/JSON.pm ( view source; MetaCPAN )
Silki::JSON;
{
  $Silki::JSON::VERSION = '0.29';
}

use strict;
use warnings;

use JSON::XS;

{
    my $json = JSON::XS->new();
    $json->pretty(1);
    $json->utf8(1);

    sub Encode { $json->encod
 ) }

    sub Decode { $json->decode( $_[1] ) }
}

1;

# ABSTRACT: A thin wrapper around a JSON::XS object

__END__
=pod

=head1 NAME

Silki::JSON - A thin wrapper around a JSON::XS object

=head1 VER
GX ( J/JA/JAU/GX/GX-0.2000_01.tar.gz, JAU, 2011; MetaCPAN )
GX/lib/GX/Serializer/JSON.pm ( view source; MetaCPAN )
zer/JSON.pm
# ----------------------------------------------------------------------------------------------------------------------

package GX::Serializer::JSON;

use GX::Exception ();

use JSON ();
----

sub serialize {

    my $self = shift;
    my $data = shift;

    my $string = eval { JSON::encode_json( $data ) };

    if ( $@ ) {
        GX::Exception->complain(
            message      => 


sub unserialize {

    my $self   = shift;
    my $string = shift;

    my $data = eval { JSON::decode_json( $string ) };

    if ( $@ ) {
        GX::Exception->complain(
            message      =
JSON-YAJL ( L/LB/LBROCARD/JSON-YAJL-0.10.tar.gz, LBROCARD, 2011; MetaCPAN )
JSON-YAJL/lib/JSON/YAJL.pm ( view source; MetaCPAN )
package JSON::YAJL;
use strict;
use warnings;
use JSON::YAJL::Generator;
use JSON::YAJL::Parser;
our $VERSION = '0.10';

1;

=head1 NAME

JSON::YAJL - An interface to the YAJL JSON parsing and generat
1 SYNOPSIS

  use JSON::YAJL;
  # see JSON::YAJL::Generator or JSON::YAJL::Parser

=head1 DESCRIPTION

YAJL is Yet Another JSON Library. YAJL is a small event-driven (SAX-style) JSON
parser written in
ng JSON generator, by Lloyd
Hilaiel. This module is a Perl interface to that library.

To find out more about YAJL, please visit http://lloyd.github.com/yajl/

For the generation library, see L<JSON::
JSON-YAJL ( L/LB/LBROCARD/JSON-YAJL-0.10.tar.gz, LBROCARD, 2011; MetaCPAN )
JSON-YAJL/lib/JSON/YAJL/Parser.pm ( view source; MetaCPAN )
package JSON::YAJL::Parser;
use strict;
use warnings;
our $VERSION = '0.10';

require XSLoader;
XSLoader::load( 'JSON::YAJL::Parser', $VERSION );

1;

=head1 NAME

JSON::YAJL::Parser - JSON parsing wi
th YAJL

=head1 SYNOPSIS

  use JSON::YAJL;
  my $text;
  my $parser = JSON::YAJL::Parser->new(
      0, 0,
      [   sub { $text .= "null\n" },
          sub { $text .= "bool: @_\n" },
          unde
  sub { $text .= "array_open\n" },
          sub { $text .= "array_close\n" },
      ]
  );
  my $json
      = '{"integer":123,"double":4,"number":3.141,"string":"a string","string2":"another string",
JSON-YAJL ( L/LB/LBROCARD/JSON-YAJL-0.10.tar.gz, LBROCARD, 2011; MetaCPAN )
JSON-YAJL/lib/JSON/YAJL/Generator.pm ( view source; MetaCPAN )
kage JSON::YAJL::Generator;
use strict;
use warnings;
our $VERSION = '0.10';

require XSLoader;
XSLoader::load( 'JSON::YAJL::Generator', $VERSION );

1;

=head1 NAME

JSON::YAJL::Generator - JSON gene
ration with YAJL

=head1 SYNOPSIS

  use JSON::YAJL;
  my $generator = JSON::YAJL::Generator->new();
  # or to beautify (indent):
  # my $generator = JSON::YAJL::Generator->new( 1, '    ' );
  $genera
u to generate JSON with YAJL. This is quite a low-level
interface for generating JSON and it accumulates JSON in an internal buffer
until you fetch it.

If you create certain invalid JSON constructs t
DataFlow-Proc-JSON ( R/RU/RUSSOZ/DataFlow-Proc-JSON-1.112100.tar.gz, RUSSOZ, 2011; MetaCPAN )
DataFlow-Proc-JSON/lib/DataFlow/Proc/JSON.pm ( view source; MetaCPAN )
:JSON;

use strict;
use warnings;

# ABSTRACT: A JSON converting processor

our $VERSION = '1.112100';    # VERSION

use Moose;
extends 'DataFlow::Proc::Converter';

use namespace::autoclean;
use JSON
r_opts
          ? JSON::Any->new( $self->converter_opts )
          : JSON::Any->new;
    },
    handles => {
        'json'          => sub { shift->converter(@_) },
        'json_opts'     => sub {
converter_opts(@_) },
        'has_json_opts' => sub { shift->has_converter_opts },
    },
    init_arg => 'json',
);

has '+converter_opts' => ( 'init_arg' => 'json_opts', );

sub _build_subs {
    m

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