Group
Extension

Matches 35359

Plack-App-Prack ( L/LE/LEEDO/Plack-App-Prack-0.02.tar.gz, LEEDO, 2012; MetaCPAN )
Plack-App-Prack/lib/Plack/App/Prack/Request.pm ( view source; MetaCPAN )
package Plack::App::Prack::Request;

use strict;
use warnings;

use JSON;
use Plack::App::Prack::Response;

my @ENV_KEYS = qw/REQUEST_METHOD PATH_INFO QUERY_STRING 
                  SERVER_NAME SERVE
ift;
  return length($data).":".$data.",";
}

sub write {
  my $self = shift;

  my $env = encode_json($self->_filter_env($self->{env}));

  my $input = "";
  my $buf = "";

  while ($self->{env}->{'p
Data-Riak-Fast ( M/MY/MYFINDER/Data-Riak-Fast-0.03.tar.gz, MYFINDER, 2012; MetaCPAN )
Data-Riak-Fast/lib/Data/Riak/Fast.pm ( view source; MetaCPAN )
package Data::Riak::Fast;

use Mouse;

use JSON::XS qw/decode_json/;
use URI;

use Data::Riak::Fast::Result;
use Data::Riak::Fast::ResultSet;
use Data::Riak::Fast::Bucket;
use Data::Riak::Fast::MapRed
@parts
            ],
        }
    );
}

sub _buckets {
    my $self = shift;

    return decode_json(
        $self->send_request({
            method => 'GET',
            uri => '/buckets',
      
,
            uri => $request_str
    });
}

sub stats {
    my $self = shift;

    return decode_json(
        $self->send_request({
            method => 'GET',
            uri => '/stats',
        
WebService-IMDBAPI ( A/AR/ARJONES/WebService-IMDBAPI-1.130030.tar.gz, ARJONES, 2013; MetaCPAN )
WebService-IMDBAPI/lib/WebService/IMDBAPI.pm ( view source; MetaCPAN )
erAgent;
use JSON;

# default options
use constant DEFAULT_USER_AGENT => 'Mozilla/5.0';
use constant DEFAULT_LANG       => 'en-US';

use constant BASE_URL => 'http://imdbapi.org/?type=json';

use Obje
earch($options);
    if ( $response->is_success ) {

        my @results;
        for ( @{ decode_json( $response->content ) } ) {
            my $result = WebService::IMDBAPI::Result->new( %{$_} );
 
nse->is_success ) {

        my $result = WebService::IMDBAPI::Result->new(
            %{ decode_json( $response->content ) } );
        return $result;
    }
    else {
        die $response->status
Clustericious ( B/BD/BDUGGAN/Clustericious-0.9909.tar.gz, BDUGGAN, 2012; MetaCPAN )
Clustericious/lib/Test/Clustericious.pm ( view source; MetaCPAN )
Test::Mojo>, and add the following new attributes and methods.

=cut

use base 'Test::Mojo';

use JSON::XS;
use YAML::XS;
use File::Slurp qw/slurp/;
use Carp;
use List::Util qw(first);
use Clustericio
t = $t->testdata('filename');

 Looks for filename, filename.json, filename.yaml in 't', 'data' or
 't/data' directories.  Parses with json or yaml if appropriate, then
 returns the object.

=cut

sub
ml", "$_.json" }
                map { $_, "t/$_", "data/$_", "t/data/$_" }
                $filename;

    my $content = slurp($filename) or croak "Missing $filename";

    return decode_json($conten
Data-Riak-Fast ( M/MY/MYFINDER/Data-Riak-Fast-0.03.tar.gz, MYFINDER, 2012; MetaCPAN )
Data-Riak-Fast/lib/Data/Riak/Fast/MapReduce/Phase/Link.pm ( view source; MetaCPAN )
package Data::Riak::Fast::MapReduce::Phase::Link;
use Mouse;

use JSON::XS ();

# ABSTRACT: Link phase of a MapReduce

with ('Data::Riak::Fast::MapReduce::Phase');

=head1 DESCRIPTION

A map/reduce li

sub pack {
    my $self = shift;

    my $href = {};

    $href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
    $href->{bucket} = $self->bucket if $self->has_buck
Data-Riak-Fast ( M/MY/MYFINDER/Data-Riak-Fast-0.03.tar.gz, MYFINDER, 2012; MetaCPAN )
Data-Riak-Fast/lib/Data/Riak/Fast/MapReduce/Phase/Map.pm ( view source; MetaCPAN )
ackage Data::Riak::Fast::MapReduce::Phase::Map;
use Mouse;
use Mouse::Util::TypeConstraints;

use JSON::XS ();

# ABSTRACT: Map phase of a MapReduce

with ('Data::Riak::Fast::MapReduce::Phase');

=hea

=cut

sub pack {
  my $self = shift;

  my $href = {};

  $href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
  $href->{language} = $self->language;
  $href->{name}
Devel-DTrace-Provider ( C/CH/CHRISA/Devel-DTrace-Provider-1.11.tar.gz, CHRISA, 2012; MetaCPAN )
Devel-DTrace-Provider/lib/Devel/DTrace/Provider.pm ( view source; MetaCPAN )
l::DTrace::Provider;

use 5.008;
use strict;
use warnings;
use vars qw/ $DTRACE_AVAILABLE /;

use JSON;

BEGIN {
	our $VERSION = '1.11';
	require XSLoader;
	eval {
            XSLoader::load('Devel::D
Data-Riak-Fast ( M/MY/MYFINDER/Data-Riak-Fast-0.03.tar.gz, MYFINDER, 2012; MetaCPAN )
Data-Riak-Fast/lib/Data/Riak/Fast/Bucket.pm ( view source; MetaCPAN )
ak::Fast::MapReduce::Phase::Reduce;

use HTTP::Headers::ActionPack::LinkList;

use JSON::XS qw/decode_json encode_json/;

with 'Data::Riak::Fast::Role::HasRiak';

=head1 DESCRIPTION

Data::Riak::Fast:
ets/%s/keys', $self->name),
        query => { keys => 'true' }
    })->first;

    return decode_json( $result->value )->{'keys'};
}

=head2 count

Count all the keys in a bucket. This uses MapReduce
ce->mapreduce;
    my ( $result ) = $map_reduce_results->results->[0];
    my ( $count ) = decode_json($result->value) || 0;
    return $count->[0];
}

=head2 remove_all

Remove all the keys from a bu
Pingdom-Client ( T/TE/TEX/Pingdom-Client-0.13.tar.gz, TEX, 2012; MetaCPAN )
Pingdom-Client/lib/Pingdom/Client.pm ( view source; MetaCPAN )
;
use LWP::UserAgent;
use JSON;
use URI::Escape ();

# see http://www.pingdom.com/services/api-documentation-rest/

# use autodie;
# use MooseX::Params::Validate;

has '_json' => (
    'is'        => 
'ro',
    'isa'       => 'JSON',
    'lazy'      => 1,
    'builder' => '_init_json',
);

has '_ua' => (
    'is'      => 'rw',
    'isa'     => 'LWP::UserAgent',
    'lazy'    => 1,
    'builder' => 
nt('Pingdom::Client/0.01');

    return $UA;
}

sub _init_json {
    my $self = shift;

    my $JSON = JSON::->new()->utf8();

    return $JSON;
}

sub _set_lasterror {
    my $self = shift;
    my $c
HTML-Widgets-NavMenu-ToJSON ( S/SH/SHLOMIF/HTML-Widgets-NavMenu-ToJSON-v0.0.1.tar.gz, SHLOMIF, 2012; MetaCPAN )
HTML-Widgets-NavMenu-ToJSON/lib/HTML/Widgets/NavMenu/ToJSON.pm ( view source; MetaCPAN )
enu::ToJSON;

use 5.008;
use strict;
use warnings FATAL => 'all';

use Carp;

use parent 'HTML::Widgets::NavMenu::Object';

use JSON qw(encode_json);

=head1 NAME

HTML::Widgets::NavMenu::ToJSON - con
idgets::NavMenu to JSON

=head1 VERSION

Version 0.0.1

=cut

our $VERSION = '0.0.1';

=head1 SYNOPSIS

    use HTML::Widgets::NavMenu::ToJSON;
    use HTML::Widgets::NavMenu::ToJSON::Data_Persistence
avMenu::ToJSON::Data_Persistence::YAML->new(
            {
                filename => '/path/to/persistence_data.yaml',
            }
        );

    my $obj = HTML::Widgets::NavMenu::ToJSON->new(
  
WebService-Bukget ( M/MA/MADCAT/WebService-Bukget-1.00.tar.gz, MADCAT, 2012; MetaCPAN )
WebService-Bukget/lib/WebService/Bukget.pm ( view source; MetaCPAN )
ON = '1.00';
}
# ABSTRACT: Provides access to the v3 Bukget API
use Mojo::Base '-base';
use Mojo::JSON;
use Mojo::UserAgent;
use Try::Tiny qw/try catch/;
use boolean;

has     '_ua'           =>  sub 
>get($u)) {
        if(my $res = $tx->success) {
            $args->{on_success}->($self => $res->json) if(defined($args->{on_success}));
        } else {
            my ($err, $code) = $tx->error;
  
=over 4

=item * on_success - A coderef that gets the WebService::Bukget instance and the decoded JSON result as parameters

=item * on_failure - A coderef that gets an arrayref of code and status as 
Hubot-Scripts-Bundle ( A/AA/AANOAA/Hubot-Scripts-Bundle-0.1.0.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot-Scripts-Bundle/lib/Hubot/Scripts/redisBrain.pm ( view source; MetaCPAN )
}
use strict;
use warnings;
use Redis;
use JSON::XS;
use Encode qw/encode_utf8 decode_utf8/;

sub load {
    my ( $class, $robot ) = @_;
    my $coder = JSON::XS->new->convert_blessed;
    my $redis =
cted to redis-server\n" if $ENV{DEBUG};
    my $json = $redis->get('hubot:storage') || '{}';
    $robot->brain->mergeData( decode_json( decode_utf8($json) ) );
    $robot->brain->on(
        'save',
 
ub {
            my ( $e, $data ) = @_;
            my $json = $coder->encode($data);
            $redis->set( 'hubot:storage', encode_utf8($json) );
        }
    );
    $robot->brain->on( 'close', s
Data-Pipeline ( J/JS/JSMITH/Data-Pipeline-0.02.tar.gz, JSMITH, 2013; MetaCPAN )
Data-Pipeline/lib/Data/Pipeline.pm ( view source; MetaCPAN )
ge namespace.

For example, Pipeline refers to Data::Pipeline::Pipeline while
JSON refers to Data::Pipeline::Adapter::JSON.

=head2 Aggregators

Aggregators allow multiple actions to be strung togethe
Log-Log4perl-Appender-Fluent ( D/DO/DOZZIE/Log-Log4perl-Appender-Fluent-0.02.tar.gz, DOZZIE, 2012; MetaCPAN )
Log-Log4perl-Appender-Fluent/lib/Log/Log4perl/Appender/Fluent.pm ( view source; MetaCPAN )
rts sending simple string
messages, but it works way better when is provided with
L<Log::Message::JSON(3)> or L<Log::Message::Structured(3)> object, because the
structure of the message will be preser
es as messages. This option
tells how should be named key if the message is not
a L<Log::Message::JSON(3)>/L<Log::Message::Structured(3)> object.

=item I<hostname_field> (default: I<none>)

Fluentd o
RRAY' && @$msg == 1;

  # repack message
  if (eval { $msg->isa('Log::Message::JSON') }) {
    # strip Log::Message::JSON blessing
    # NOTE: the resulting hash(ref) should be tied to Tie::IxHash, bu
Hubot ( A/AA/AANOAA/Hubot-0.1.3.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot/lib/Hubot/Robot.pm ( view source; MetaCPAN )
 CLI. named `hubot`
    $ perldoc hubot

    # make sure `hubot-scripts.json` is exist in current working directory
    use JSON::XS;
    use Cwd 'cwd';
    use Hubot::Robot;
    my $robot = Hubot::Ro
ptsFile = "$cwd/hubot-scripts.json";
            if (-f $scriptsFile) {
                my $json = read_file($scriptsFile);
                my $scripts = decode_json($json);
                $robot->lo
Hubot ( A/AA/AANOAA/Hubot-0.1.3.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot/lib/Hubot/Scripts/tweet.pm ( view source; MetaCPAN )
t::Scripts::tweet;
{
  $Hubot::Scripts::tweet::VERSION = '0.1.3';
}
use strict;
use warnings;
use JSON::XS;

sub load {
    my ( $class, $robot ) = @_;
    $robot->hear(
        qr/https?:\/\/(mobile\
ps://api.twitter.com/1/statuses/show/'
                  . $msg->match->[1]
                  . '.json' )->get(
                sub {
                    my ( $body, $hdr ) = @_;
                    r
^2/ );
                    print "$body\n" if $ENV{DEBUG};
                    my $tweet = decode_json($body);
                    $msg->send("$tweet->{user}{screen_name}: $tweet->{text}");
          
Hubot-Scripts-Bundle ( A/AA/AANOAA/Hubot-Scripts-Bundle-0.1.0.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot-Scripts-Bundle/lib/Hubot/Scripts/bugzilla.pm ( view source; MetaCPAN )
illa;
{
  $Hubot::Scripts::bugzilla::VERSION = '0.1.0';
}
use utf8;
use strict;
use warnings;
use JSON::XS;

my %PRIORITY_MAP = (
    '---'   => '☆☆☆☆☆',
    Lowest  => '★☆☆☆☆',
  
★★☆',
    Highest => '★★★★★',
);

sub load {
    my $client = JSONRPC->new( { url => $ENV{HUBOT_BZ_JSONPRC_URL} } );

    my ( $class, $robot ) = @_;
    $robot->hear(
        qr/b(?:u
  );
        }
    );
}

sub speak_bug {
    my ( $msg, $body, $hdr ) = @_;
    my $data = decode_json($body);
    my $bug = @{ $data->{result}{bugs} ||= [] }[0];
    $msg->send(
        sprintf "#%s 
Hubot ( A/AA/AANOAA/Hubot-0.1.3.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot/lib/Hubot/Scripts/shorten.pm ( view source; MetaCPAN )
se strict;
use warnings;
use URI;
use URI::QueryParam;
use HTTP::Request;
use LWP::UserAgent;
use JSON::XS;
use Encode 'decode';

sub load {
    my ( $class, $robot ) = @_;
    $robot->hear(
        q
$ENV{HUBOT_BITLY_API_KEY},
                    longUrl => $bitly,
                    format  => 'json'
                );
                my $ua  = LWP::UserAgent->new;
                my $req = HTTP
>request($req);
                return unless $res->is_success;
                my $data = decode_json( $res->content );
                $bitly = $data->{data}{url};
            }

            $msg->h
Hubot-Scripts-Bundle ( A/AA/AANOAA/Hubot-Scripts-Bundle-0.1.0.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot-Scripts-Bundle/lib/Hubot/Scripts/print.pm ( view source; MetaCPAN )
 Hubot::Scripts::print;
$Hubot::Scripts::print::VERSION = '0.1.10';
use strict;
use warnings;
use JSON::XS;

sub load {
    my ( $class, $robot ) = @_;
    $robot->hear(
        qr/^(?:print|say):? (.
           return if ( !$body || $hdr->{Status} !~ m/^2/ );
                    my $data = decode_json($body);
                    $msg->send( split /\n/,
                        $data->{stdout} || $d
Hubot ( A/AA/AANOAA/Hubot-0.1.3.tar.gz, AANOAA, 2013; MetaCPAN )
Hubot/lib/Hubot/Adapter/Campfire.pm ( view source; MetaCPAN )

extends 'Hubot::Adapter';

use AnyEvent;
use AnyEvent::HTTP;
use AnyEvent::Campfire::Client;
use JSON::XS;
use Encode 'encode_utf8';
use HTTP::Request;
use LWP::UserAgent;
use Try::Tiny;

use Hubot::
                ),
                );
                $req->header( 'Accept',        'application/json' );
                $req->header( 'Authorization', $bot->authorization );
                my $res
cess;

                my $userData;
                try {
                    $userData = decode_json( $res->content );
                }
                catch {
                    $bot->emit( 'erro

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