Group
Extension

Matches 35359

WebService-Scriptogram ( S/SH/SHUFF/WebService-Scriptogram-v0.0.2.tar.gz, SHUFF, 2012; MetaCPAN )
WebService-Scriptogram/lib/WebService/Scriptogram.pm ( view source; MetaCPAN )
rticle/post/",
    delete_url      => "$SCRIPTOGRAM_API/article/delete/",
    response_parser => 'JSON',
    debug => 1,
);

=head1 SYNOPSIS

    use WebService::Scriptogram;

    my $sg = WebService:
VK-MP3 ( E/EA/EAX/VK-MP3-0.08.tar.gz, EAX, 2012; MetaCPAN )
VK-MP3/lib/VK/MP3.pm ( view source; MetaCPAN )
;
use utf8;

use LWP;
use LWP::Protocol::https;
use HTML::Entities;
use URI::Escape;
use JSON::XS qw/decode_json/;
use Encode;

our $VERSION = 0.08;

sub new {
  my ($class, %args) = @_;
  die 'USAGE:
s->is_success;

  my $json_str = (split /<!>/, $res->decoded_content)[5];
  $json_str =~ s/'/"/gs;
  $json_str = Encode::encode('utf-8', $json_str);
  my $json = decode_json($json_str);
  return 'Inva
lid response' unless defined $json->{all} && ref($json->{all}) eq 'ARRAY';

  my @rslt;
  for my $item(@{$json->{all}}) {
    next unless ref $item eq 'ARRAY' && scalar @{$item} > 7;
    my $name = de
WWW-Authy ( G/GE/GETTY/WWW-Authy-0.002.tar.gz, GETTY, 2012; MetaCPAN )
WWW-Authy/lib/WWW/Authy.pm ( view source; MetaCPAN )
 easy Authy API


use MooX qw(
	+LWP::UserAgent
	+HTTP::Request::Common
	+URI
	+URI::QueryParam
	+JSON
);


use Carp qw( croak );

our $VERSION ||= '0.000';


has api_key => (
	is => 'ro',
	required =
 'has_useragent_timeout',
);


has json => (
	is => 'ro',
	lazy => 1,
	builder => 1,
);

sub _build_json {
	my $json = JSON->new;
	$json->allow_nonref;
	return $json;
}

##############################
 };
}

sub make_url {
	my ( $self, @args ) = @_;
	my $url = join('/',$self->base_uri,'protected','json',@args);
	my $uri = URI->new($url);
	$uri->query_param( api_key => $self->api_key );
	return $uri
WWW-NOS-Open ( I/IP/IPENBURG/WWW-NOS-Open-0.100.tar.gz, IPENBURG, 2012; MetaCPAN )
WWW-NOS-Open/lib/WWW/NOS/Open.pm ( view source; MetaCPAN )
s
  qw(HTTP_OK HTTP_BAD_REQUEST HTTP_UNAUTHORIZED HTTP_FORBIDDEN HTTP_INTERNAL_SERVER_ERROR);
use JSON;
use LWP::UserAgent;
use Log::Log4perl qw(:easy get_logger);
use Moose qw/around has with/;
use M
ERR{'INTERNAL_SERVER'},
        );
    }
    elsif ( $response->code > HTTP_OK ) {
        my $json = JSON->new;
        if ( $response->code == HTTP_BAD_REQUEST ) {
            ## no critic qw(Requir
     NOSOpenBadRequestException->throw(
                ## use critic
                'error' => $json->decode( $response->decoded_content ),
            );
        }
        elsif ( $response->code =
ZeroMQ-PubSub ( R/RE/REVMISCHA/ZeroMQ-PubSub-0.10.tar.gz, REVMISCHA, 2012; MetaCPAN )
ZeroMQ-PubSub/lib/ZeroMQ/PubSub.pm ( view source; MetaCPAN )
package ZeroMQ::PubSub;

use Moose;
use ZMQ::LibZMQ2;
use JSON;
use namespace::autoclean;

with 'MooseX::Callbacks';

has 'context' => (
    is => 'rw',
    isa => 'ZMQ::LibZMQ2::Context',
    lazy_bu
ZeroMQ-PubSub ( R/RE/REVMISCHA/ZeroMQ-PubSub-0.10.tar.gz, REVMISCHA, 2012; MetaCPAN )
ZeroMQ-PubSub/lib/ZeroMQ/PubSub/Client.pm ( view source; MetaCPAN )
e Moose;
extends 'ZeroMQ::PubSub';

use ZMQ::LibZMQ2;
use ZMQ::Constants ':all';
use JSON qw/encode_json decode_json/;
use Carp qw/croak/;
use List::Util qw/shuffle/;

# should only be used internally
= zmq_recv($self->subscribe_sock);
    my $msg_str = zmq_msg_data($msg_raw);
    my $msg = decode_json($msg_str);
    $self->dispatch_event($msg);
}

after 'subscribe' => sub {
    my ($self, $evt, $c
re we're connected
    $self->connect_publish_sock;

    my $json_str = encode_json($msg);
    my $res = zmq_send($self->publish_sock, $json_str);
    $self->print_debug("Published $evt, res=$res");

ZeroMQ-PubSub ( R/RE/REVMISCHA/ZeroMQ-PubSub-0.10.tar.gz, REVMISCHA, 2012; MetaCPAN )
ZeroMQ-PubSub/lib/ZeroMQ/PubSub/Server.pm ( view source; MetaCPAN )
e Moose;
extends 'ZeroMQ::PubSub';

use ZMQ::LibZMQ2;
use ZMQ::Constants ':all';
use JSON qw/encode_json decode_json/;
use Clone qw/clone/;
use Carp qw/croak/;

# socket to listen for client events
# 
from JSON, or undef if failure.

=cut

sub recv {
    my ($self) = @_;

    my $msg = zmq_recv($self->publish_sock);
    my $json_str = zmq_msg_data($msg);
    my $json = eval { decode_json($json_str)
 };
    unless ($json) {
        warn "Got invalid event: failed to parse JSON: $@";
        return;
    }

    return $json;
}


=head2 broadcast($event)

Sends $event to all connected subscribers.

AnyEvent-RabbitMQ-RPC ( A/AL/ALEXMV/AnyEvent-RabbitMQ-RPC-0.5.tar.gz, ALEXMV, 2012; MetaCPAN )
AnyEvent-RabbitMQ-RPC/lib/AnyEvent/RabbitMQ/RPC.pm ( view source; MetaCPAN )
if ($args{serialize} eq "JSON") {
        require JSON::Any;
        JSON::Any->import;
        my $json = JSON::Any->new;
        $self->{serialize}   = sub { $json->objToJson( [@_] ) };
        $sel
f->{unserialize} = sub { (@{ $json->jsonToObj(@_) })[0] };
    } elsif ($args{serialize} eq "Storable") {
        require Storable;
        $self->{serialize}   = sub { Storable::nfreeze( [@_] )};
   
Any/Dump> and L<YAML::Any/Load> to serialize and deserialize
data.

=item JSON

Use L<JSON::Any/objToJson> and L<JSON::Any/jsonToObj> to serialize and
deserialize.

=item Storable

Use L<Storable/nfre
Dist-Zilla-Plugins-CJM ( C/CJ/CJM/Dist-Zilla-Plugins-CJM-4.11.tar.gz, CJM, 2012; MetaCPAN )
Dist-Zilla-Plugins-CJM/lib/Dist/Zilla/Plugin/Test/PrereqsFromMeta.pm ( view source; MetaCPAN )
c License or the Artistic License for more details.
#
# ABSTRACT: Check the prereqs from our META.json
#---------------------------------------------------------------------

use 5.008;
our $VERSION =
ncluded a META.json:

sub prune_files
{
  my $self = shift;

  my $files = $self->zilla->files;

  unless (grep { $_->name eq 'META.json' } @$files) {
    $self->log("WARNING: META.json not found, rem
ereqs.t");
    @$files = grep { $_->name ne 't/00-all_prereqs.t' } @$files;
  } # end unless META.json

  return;
} # end prune_files

#----------------------------------------------------------------
Data-FlexSerializer ( A/AV/AVAR/Data-FlexSerializer-1.08.tar.gz, AVAR, 2012; MetaCPAN )
Data-FlexSerializer/lib/Data/FlexSerializer.pm ( view source; MetaCPAN )
al DEBUG => { int => 1, default => 0, env => 1 };

use List::Util qw(min);
use Storable qw();
use JSON::XS qw();
use Sereal::Decoder qw();
use Sereal::Encoder qw();
use Compress::Zlib qw(Z_DEFAULT_COM
a     => Bool,
    default => 0,
);

enum DataFlexSerializerOutputFormats, [ qw(
    storable
    json
    sereal
) ];

coerce DataFlexSerializerOutputFormats,
    from Str,
    via { lc $_ };

has ou
_format => (
    is      => 'rw',
    isa     => DataFlexSerializerOutputFormats,
    default => 'json',
    coerce  => 1,
);

has sereal_encoder => (
    is         => 'ro',
    isa        => Object,
Dist-Zilla-Plugins-CJM ( C/CJ/CJM/Dist-Zilla-Plugins-CJM-4.11.tar.gz, CJM, 2012; MetaCPAN )
Dist-Zilla-Plugins-CJM/lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm ( view source; MetaCPAN )
self) = @_;

  my $files = $self->zilla->files;
  @$files = grep { not($_->name =~ /^META\.(?:yml|json)$/ and
                       $_->isa('Dist::Zilla::File::OnDisk')) } @$files;

  return;
} # end
Log-Syslog-Fast ( A/AT/ATHOMASON/Log-Syslog-Fast-0.61.tar.gz, ATHOMASON, 2012; MetaCPAN )
Log-Syslog-Fast/benchmarks/bench-tarballs.pl ( view source; MetaCPAN )
[0-9.]+)/s}) {
                $results{$class}{$name}{sprintf "%4d", $1} = 0+$2;
            }
        }
    }
}

use JSON;
print JSON->new->pretty->canonical->encode(\%results);

END { chdir '/'; }
Dist-Zilla-Plugins-CJM ( C/CJ/CJM/Dist-Zilla-Plugins-CJM-4.11.tar.gz, CJM, 2012; MetaCPAN )
Dist-Zilla-Plugins-CJM/lib/Dist/Zilla/Plugin/MakeMaker/Custom.pm ( view source; MetaCPAN )
self) = @_;

  my $files = $self->zilla->files;
  @$files = grep { not($_->name =~ /^META\.(?:yml|json)$/ and
                       $_->isa('Dist::Zilla::File::OnDisk')) } @$files;

  return;
} # end
s plugin).

=item C<%meta>

The hash of metadata (in META 2 format) that will be stored in F<META.json>.

=item C<$perl_prereq>

The minimum version of Perl required (from the prerequisites in the met
App-Difio-dotCloud ( A/AT/ATODOROV/App-Difio-dotCloud-2.02.tar.gz, ATODOROV, 2012; MetaCPAN )
App-Difio-dotCloud/lib/App/Difio/dotCloud.pm ( view source; MetaCPAN )
gs;

use JSON;
use LWP::UserAgent;

# load dotCloud environment
local $/;
open( my $fh, '<', '/home/dotcloud/environment.json' );
my $json_text   = <$fh>;
my $dotcloud_env = decode_json( $json_text );
n' => $name_ver[0], 'v' => $name_ver[1]});
}


$data->{'installed'} = [ @installed ];

my $json_data = to_json($data); # , { pretty => 1 });

my $ua = new LWP::UserAgent(('agent' => "$NAME/$VERSION"))
otb.rhcloud.com/application/register/', { json_data => $json_data});

if (! $response->is_success) {
    die $response->status_line;
}

my $content = from_json($response->decoded_content);
print "Difi
WWW-NOS-Open ( I/IP/IPENBURG/WWW-NOS-Open-0.100.tar.gz, IPENBURG, 2012; MetaCPAN )
WWW-NOS-Open/scripts/DummyServer.pl ( view source; MetaCPAN )
h my %OUTPUT => (
    'json' => q{application/json},
    'xml'  => q{text/xml},
    'php'  => q{text/plain},
);
Readonly::Hash my %RESPONSE => (
    'version' => {
        'json' => q{{
    "version":
2:{s:7:"version";s:2:"v1";s:5:"build";s:5:"0.0.1";}}}},
    },
    'latest_article' => {
        'json' => q{{
"latest_article": [
    [
        {
            "id": "156833"
            "type": "artic
]></keyword>
        </keywords>
    </article>
</list>},
    },
    'latest_video' => {
        'json' => q{{
    "latest_video": [
        [
            {
                "id": "175327"
            
Template-Semantic ( T/TO/TOMITA/Template-Semantic-0.09.tar.gz, TOMITA, 2012; MetaCPAN )
Template-Semantic/lib/Template/Semantic/Cookbook.pod ( view source; MetaCPAN )
 'script[src="foo.js"]@src' => 'http://prod-server/foo.js',
      '//script[2]' => 'var = ' . JSON::to_json($var_to_js),
  });
  __DATA__
  <html>
  <script type="text/javascript" src="foo.js"></scrip
XML-RSS-JavaScript ( B/BR/BRICAS/XML-RSS-JavaScript-0.64.tar.gz, BRICAS, 2012; MetaCPAN )
XML-RSS-JavaScript/lib/XML/RSS/JavaScript.pm ( view source; MetaCPAN )
head2 save_json( )

Pass in the path to a file you wish to write your javascript in. Optionally
you can pass in any options that would normally get passed to C<as_json>.

=cut

sub save_json {
    my 
 $self, $file, @options ) = @_;
    $self->_save( 'as_json', $file, @options );
}

=head2 as_json( )

as_json will return a string containing json suitable for 
generating text for your RSS object. Yo
the name of the JSON object (default: RSSJSON).

=cut

sub as_json {
    my ( $self, $max, $object_name ) = @_;
    my $items = scalar @{ $self->{ items } };
    $object_name = 'RSSJSON' unless define
AnyMQ-Pg ( R/RE/REVMISCHA/AnyMQ-Pg-0.01.tar.gz, REVMISCHA, 2012; MetaCPAN )
AnyMQ-Pg/lib/AnyMQ/Trait/Pg.pm ( view source; MetaCPAN )
package AnyMQ::Trait::Pg;

# use 5.010;

use Any::Moose 'Role';

use AnyEvent::Pg 0.04;
use JSON;
use Try::Tiny;

has 'debug' => (
    is => 'rw',
    isa => 'Bool',
    default => 0,
);

has 'dsn' =>

);

has 'is_connected' => (
    is => 'rw',
    isa => 'Bool',
);

has '_json' => ( is => 'rw', lazy_build => 1, isa => 'JSON' );

has '_pg_query_watchers' => (
    is => 'ro',
    isa => 'ArrayRef',
construct and connect our client object
    $self->_client;
}

# JSON codec pack
sub _build__json {
    my ($self) = @_;
    return JSON->new->utf8;
}

sub _build_client {
    my ($self) = @_;

    my
Gearman-Driver ( P/PL/PLU/Gearman-Driver-0.02007.tar.gz, PLU, 2012; MetaCPAN )
Gearman-Driver/lib/Gearman/Driver.pm ( view source; MetaCPAN )
el free to setup your C<$driver>
this way:

    package My::Workers::One;

    use Moose;
    use JSON::XS;
    extends 'Gearman::Driver::Worker::Base';

    # this method will be registered with gear
ode_json {
        my ( $self, $result ) = @_;
        return JSON::XS::encode_json($result);
    }

    sub decode_json {
        my ( $self, $workload ) = @_;
        return JSON::XS::decode_json($w
_method_by_name($method)->body,
                        decode => 'decode_json',
                        encode => 'encode_json',
                        name   => $method,
                    },
    
Mojolicious-Plugin-ServerSession ( J/JO/JONTAYLOR/Mojolicious-Plugin-ServerSession-0.01.zip, JONTAYLOR, 2012; MetaCPAN )
Mojolicious-Plugin-ServerSession/lib/Mojolicious/Plugin/ServerSession.pm ( view source; MetaCPAN )
erver_session_key",
    load => sub { 
      my ($c, $key) = @_;
      my $session_row;
      use JSON;

      unless($session_row = $c->app->schema->resultset('Session')->find($key)) {
        $sessi
->id();
      }

      return( $key, decode_json($session_row->content));
    },
    store => sub { 
      my ($c, $key, $session_hash) = @_;
      use JSON;

      my $session = $c->app->schema->resu
ltset('Session')->find($key);
      if($session) {
        $session->content( encode_json($session_hash) );
        $session->update();
      }
    }
  });


=head1 DESCRIPTION

This is a little plugi

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