Group
Extension

Matches 35359

Plack-Middleware-SocketIO ( V/VT/VTI/Plack-Middleware-SocketIO-0.00904.tar.gz, VTI, 2011; MetaCPAN )
Plack-Middleware-SocketIO/lib/Plack/Middleware/SocketIO/Connection.pm ( view source; MetaCPAN )
package Plack::Middleware::SocketIO::Connection;

use strict;
use warnings;

use JSON ();
use Try::Tiny;

sub new {
    my $class = shift;

    my $self = {@_};
    bless $self, $class;

    $self->{o
 $self = shift;
    my ($message) = @_;

    if (ref $message) {
        $message = '~j~' . JSON::encode_json($message);
    }

    return '~m~' . length($message) . '~m~' . $message;
}

sub _generate
.*)/) {
                my $json;

                try {
                    $json = JSON::decode_json($1);
                };

                return $json if defined $json;

                return $
Plack-Middleware-SocketIO ( V/VT/VTI/Plack-Middleware-SocketIO-0.00904.tar.gz, VTI, 2011; MetaCPAN )
Plack-Middleware-SocketIO/lib/Plack/Middleware/SocketIO/Base.pm ( view source; MetaCPAN )
package Plack::Middleware::SocketIO::Base;

use strict;
use warnings;

use JSON   ();
use Encode ();
use Try::Tiny;
use Scalar::Util qw(weaken);

use Plack::Request;
use Plack::Middleware::SocketIO::H
App-Donburi ( M/MI/MIKIHOSHI/App-Donburi-0.03.tar.gz, MIKIHOSHI, 2011; MetaCPAN )
App-Donburi/lib/App/Donburi/Web/Dispatcher.pm ( view source; MetaCPAN )
er = Router::Simple->new();
    $router->connect('/', { controller => 'JSONRPC', action => 'call' }, {on_match => \&is_called_json_rpc});
    $router->connect('/', { controller => 'Root', action => 'i
->{action}, $res);
    } else {
        return [ 404, [], ['not found'] ];
    }
}

sub is_called_json_rpc {
    my ($env, $match) = @_;
    my $req = App::Donburi::Web::Request->new($env);
    return
App-SD ( S/SP/SPANG/App-SD-0.75.tar.gz, SPANG, 2011; MetaCPAN )
App-SD/lib/App/SD/CLI/Command/Publish.pm ( view source; MetaCPAN )
age App::SD::Server::Static;
use Any::Moose;
extends 'App::SD::Server';
use Params::Validate;
use JSON;

sub log_request { }

sub send_content {
    my $self = shift;
    my %args = validate( @_, { co
=> 0, static => 0 } );

    if ( $args{'encode_as'} && $args{'encode_as'} eq 'json' ) {
        $args{'content'} = to_json( $args{'content'} );
    }

    return $args{'content'};
}

sub _send_redirec
App-Donburi ( M/MI/MIKIHOSHI/App-Donburi-0.03.tar.gz, MIKIHOSHI, 2011; MetaCPAN )
App-Donburi/lib/App/Donburi/Web/C/JSONRPC.pm ( view source; MetaCPAN )
package App::Donburi::Web::C::JSONRPC;
use strict;
use warnings;

use parent 'App::Donburi::Web::C';

use JSON;

use App::Donburi::Util;

sub do_call {
    my $self = shift;
    my $method = $self->re
q->param('method');
    my $params = JSON->new->utf8->decode($self->req->param('params') || {});

    my $text = $params->{text};
    my $channel = $params->{channel};
    unless (
        $method eq 
 error?
        return [
            500,
            [ 'Content-Type' => 'application/json' ],
            [ JSON->new->utf8->encode({ message => 'internal server error', code => 000 }) ]
        ];
NSMS-API ( T/TB/TBR/NSMS-API-0.006.tar.gz, TBR, 2011; MetaCPAN )
NSMS-API/lib/NSMS/API.pm ( view source; MetaCPAN )
:Dumper;

use URI::Escape;
use HTTP::Request::Common;
use HTTP::Response;
use LWP::UserAgent;
use JSON;
use utf8;

# ABSTRACT: API para enviar SMS através da NSMS (http://www.nsms.com.br/)
our $VERSI
  => 1,
    default => sub {
        my $self = shift;
        join( '/', $self->baseurl, 'get', 'json' )
            . '?to=55'
            . $self->to
            . '&content='
            . uri_esc
> 'Bool',
    default => 0
);

sub _json_to_struct {
    my ( $self, $ret ) = @_;
    $ret = $ret->content if ref($ret) eq 'HTTP::Response';
    my $st = decode_json($ret);
    print Dumper($st) if $s
App-SocialCalc-Multiplayer ( A/AU/AUDREYT/App-SocialCalc-Multiplayer-20110626.tar.gz, AUDREYT, 2011; MetaCPAN )
App-SocialCalc-Multiplayer/socialcalc/third-party/lib/PocketIO/Transport/Base.pm ( view source; MetaCPAN )
package PocketIO::Transport::Base;

use strict;
use warnings;

use JSON   ();
use Encode ();
use Try::Tiny;
use Scalar::Util qw(weaken);

use Plack::Request;
use PocketIO::Handle;
use PocketIO::Pool;
App-SocialCalc-Multiplayer ( A/AU/AUDREYT/App-SocialCalc-Multiplayer-20110626.tar.gz, AUDREYT, 2011; MetaCPAN )
App-SocialCalc-Multiplayer/socialcalc/third-party/lib/PocketIO/Connection.pm ( view source; MetaCPAN )
package PocketIO::Connection;

use strict;
use warnings;

use AnyEvent;
use JSON ();
use Encode ();
use Try::Tiny;

use PocketIO::Pool;

use constant DEBUG => $ENV{POCKETIO_CONNECTION_DEBUG};

sub new
 $self = shift;
    my ($message) = @_;

    if (ref $message) {
        $message = '~j~' . JSON::encode_json($message);
    }
    else {
        $message = Encode::encode('UTF-8', $message);
    }

 
           my $json;

                try {
                    $json = JSON::decode_json(Encode::encode('UTF-8', $1));
                };

                return $json if defined $json;

            
CatalystX-ExtJS ( P/PE/PERLER/CatalystX-ExtJS-2.1.3.tar.gz, PERLER, 2011; MetaCPAN )
CatalystX-ExtJS/tutorial/lib/MyApp/Controller/Calculator.pm ( view source; MetaCPAN )
e;
	BEGIN { extends 'Catalyst::Controller' };
	with 'CatalystX::Controller::ExtJS::Direct';

	use JSON::XS;
	
	sub add : Chained('/') : Path : CaptureArgs(1) {
		my($self,$c, $arg) = @_;
		$c->stash->
->body( $c->stash->{add} + $arg );
	}
	
	sub echo : Local : Direct : DirectArgs(1) {
		my ($self, $c) = @_;
		$c->res->content_type('application/json');
		$c->res->body(encode_json($c->req->data));
	}
CGI-UploadEngine ( R/RO/ROGERHALL/CGI-UploadEngine-0.93.tar.gz, ROGERHALL, 2011; MetaCPAN )
CGI-UploadEngine/lib/CGI/UploadEngine.pm ( view source; MetaCPAN )
                            if(!response.responseText.match(/ERROR: /)){ 
					file_id = Ext.util.JSON.decode(response.responseText).success;
					Ext.fly(file_upload_box).remove();
					Ext.fly(file_
 the JSON
					try{
						file_id = Ext.util.JSON.decode(response.responseText).success;
						Ext.fly(file_control).insertHtml('afterBegin', '$error_image'+file_id);
					}catch(e){
						//JSON deco
                        if(!response.responseText.match(/ERROR: /)){ 
    					file_id = Ext.util.JSON.decode(response.responseText).success;
    					Ext.fly(file_upload_box).remove();
    					Ext.f
WWW-ProximoBus ( K/KI/KIMBREL/WWW-ProximoBus-0.01.tar.gz, KIMBREL, 2011; MetaCPAN )
WWW-ProximoBus/lib/WWW/ProximoBus.pm ( view source; MetaCPAN )
package WWW::ProximoBus;

use strict;
use warnings;

use Any::Moose;
use Carp;
use JSON;
use LWP::UserAgent;

our $VERSION = '0.01';

has 'api_host' => ( is => 'rw', default => 'proximobus.appspot.com
_for($path);
    my $res = $self->ua->get($uri);
    if ($res->is_success) {
        return JSON::decode_json($res->content);
    }
    else {
        die "ProximoBus HTTP error " . $res->code . ": " 
gency.json";
    return $self->get($path);
}

sub routes {
    my $self = shift;
    my ($agency) = @_;
    croak "need an agency" unless ($agency);

    my $path = "/agencies/$agency/routes.json";
  
WebService-MoviePosterDB ( C/CJ/CJK/WebService-MoviePosterDB-0.18.tar.gz, CJK, 2011; MetaCPAN )
WebService-MoviePosterDB/lib/WebService/MoviePosterDB/Poster.pm ( view source; MetaCPAN )
ocation
));

sub _new {
    my $class = shift;
    my $json = shift;
    my $self = {};

    bless $self, $class;

    $self->image_location($json->{'image_location'});

    return $self;
}

=head1 ME
Job-Machine ( K/KA/KAARE/Job-Machine-0.18.tar.gz, KAARE, 2011; MetaCPAN )
Job-Machine/lib/Job/Machine/DB.pm ( view source; MetaCPAN )
hine::DB::VERSION = '0.18';
}

use strict;
use warnings;
use Carp qw/croak confess/;
use DBI;
use JSON;

use constant QUEUE_PREFIX    => 'jm:';
use constant RESPONSE_PREFIX => 'jmr:';

sub new {
	my (

	$args{schema}   ||= 'jobmachine';
	return bless \%args, $class;
}

sub json {
	my ($self) = @_;
	return $self->{json} ||= JSON->new->allow_nonref;
}

sub listen {
	my ($self, %args) = @_;
	my $queue
;
	my $class = $self->fetch_class($queue);
	$self->{current_table} = 'task';
	my $frozen = $self->json->encode($data);
	my $sql = qq{
		INSERT INTO
			"$self->{schema}".$self->{current_table}
			(clas
CatalystX-ExtJS ( P/PE/PERLER/CatalystX-ExtJS-2.1.3.tar.gz, PERLER, 2011; MetaCPAN )
CatalystX-ExtJS/lib/CatalystX/Controller/ExtJS/ImageChooser.pm ( view source; MetaCPAN )
> 'root/static/images',
          image_chooser_url => '/static/images'
      }
  );
  
  # use a JSON view
  
  # output is available at /images
  
  1;

Example at L<http://www.extjs.com/deploy/dev/
/chooser.html>.

=head1 DESCRIPTION

This module generates an object which can be serialized to a json string. The ImageChooser class of ExtJS expects
the data in this way.

You can even look in subdi
CGI-UploadEngine ( R/RO/ROGERHALL/CGI-UploadEngine-0.93.tar.gz, ROGERHALL, 2011; MetaCPAN )
CGI-UploadEngine/Controller/Upload.pm ( view source; MetaCPAN )
e of mine, and remove the exception origin 
		# from the end of the string as it will mess up the JSON
		if($@ =~ /(ERROR:.*)at \/.*/){
			# Exception is mine, handle it
			$c->stash->{'success'} = '"
Bundle-Theory ( D/DW/DWHEELER/Bundle-Theory-1.08.tar.gz, DWHEELER, 2011; MetaCPAN )
Bundle-Theory/lib/Bundle/Theory.pm ( view source; MetaCPAN )
TML::Mason

HTML::Parser

IO::All

IO::Stringy

Image::Info

Imager

Iterator

Iterator::Util

JSON

JSON::XS

Lingua::EN::Inflect

Lingua::Strfname

List::MoreUtils

List::Util

Locale::Maketext

Luc
:Deep

Test::Differences

Test::Exception

Test::File

Test::File::Contents

Test::Harness

Test::JSON

Test::MockModule

Test::More

Test::NoWarnings

Test::Number::Delta

Test::Output

Test::Perl::C
Bash-Completion-Plugins-cpanm ( P/PE/PERLER/Bash-Completion-Plugins-cpanm-0.0.2.tar.gz, PERLER, 2011; MetaCPAN )
Bash-Completion-Plugins-cpanm/lib/Bash/Completion/Plugins/cpanm.pm ( view source; MetaCPAN )
use base 'Bash::Completion::Plugin';

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use JSON;

use Bash::Completion::Utils qw( command_in_path );

sub should_activate {
    my @commands = qw
= $ua->request(
        POST 'http://api.metacpan.org/release/_search',
        Content => encode_json(
            {   size   => 1000,
                fields => ['distribution'],
                sort
al {
        my $json = decode_json( $res->content );
        $req->candidates('') unless ( $json->{hits} );
        my @candidates;
        my $exact_match = 0;
        for ( @{ $json->{hits}->{hits}
WWW-Shorten-Googl ( M/ME/MERIXZON/WWW-Shorten-Googl-1.02.tar.gz, MERIXZON, 2011; MetaCPAN )
WWW-Shorten-Googl/lib/WWW/Shorten/Googl.pm ( view source; MetaCPAN )
   no strict 'refs';
    *{"main::getlinkstats"} = *{"WWW::Shorten::Googl::getlinkstats"};
}

use JSON::Any;
use Carp;

use constant API_URL => 'https://www.googleapis.com/urlshortener/v1/url';
use co
 my $url = shift or croak 'No URL passed to makeashorterlink';

    my $json = JSON::Any->new;
    my $content = $json->objToJson( { longUrl => $url, } );

    my $res = _request( 'post', API_URL, Con
on/json';

    my $resp = $ua->$method( $url, %headers, @args );
    die "Request failed - " . $resp->status_line unless $resp->is_success;

    my $json = JSON::Any->new;
    my $obj  = $json->jsonTo
WebService-MoviePosterDB ( C/CJ/CJK/WebService-MoviePosterDB-0.18.tar.gz, CJK, 2011; MetaCPAN )
WebService-MoviePosterDB/lib/WebService/MoviePosterDB/Movie.pm ( view source; MetaCPAN )
;
    my $json = shift;
    my $self = {};

    if (defined $json->{'errors'}) { croak join("; ", map {s/\.*$//; $_} @{$json->{'errors'}}); }

    bless $self, $class;

    $self->imdb($json->{'imdb'}
   $self->title($json->{'title'});
    $self->year($json->{'year'});
    $self->page($json->{'page'});
    $self->posters( [ map { WebService::MoviePosterDB::Poster->_new($_) } @{$json->{'posters'}} ]
Cheater ( A/AG/AGENT/Cheater-0.10.tar.gz, AGENT, 2011; MetaCPAN )
Cheater/lib/Cheater.pm ( view source; MetaCPAN )
g'>, C<1.32>, and etc, to describe the value
range of data table field.

=item *

It can generate JSON or SQL insert statements to ease importing to RDMBSes like MySQL/PostgreSQL.

=back

Below is a v
/data/departments.schema.json
  Wrote ./data/departments.rows.json
  Wrote ./data/employees.schema.json
  Wrote ./data/employees.rows.json

We see that it generates two F<.json> data files for the C<d
ctively. For example, the F<data/emplyees.rows.json> file on my machine resulting from
a particular run looks like this:

  $ cat data/employees.rows.json
  [["id","name","age","tel","birthday","heigh

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