Group
Extension

Matches 35358

Flickr-API2 ( T/TJ/TJC/Flickr-API2-2.50.tar.gz, TJC, 2016; MetaCPAN )
Flickr-API2/lib/Flickr/API2/Raw.pm ( view source; MetaCPAN )
package Flickr::API2::Raw;
use 5.12.0;
use warnings;
use JSON qw(decode_json);
use Digest::MD5 qw(md5_hex);
use Compress::Zlib;
use LWP::UserAgent;
use Retry;
use Encode;
use Carp qw(croak);
use paren
json = eval { decode_json($content) };
    if ($@) {
        croak("Failed to parse API response as JSON. Error=$@\nContent=$content\n");
    }

    if ( $json->{stat} eq 'ok' ) {
        return $json
tage, I think.
    }

    croak(sprintf("API call failed: \%s (\%s)\n",
                $json->{message}, $json->{code})
    );
}

=head2 do_request

Calls LWP::UserAgent's ->request method, but does 
Test-Mountebank ( D/DA/DAGFINNR/Test-Mountebank-0.001.tar.gz, DAGFINNR, 2016; MetaCPAN )
Test-Mountebank/lib/Test/Mountebank/Predicate/Equals.pm ( view source; MetaCPAN )
ountebank::Types qw( HTTPHeaders );
use MooseX::Types::HTTPMethod qw(HTTPMethod11);
use JSON::Tiny qw(encode_json);

has method      => ( is => 'ro', isa => HTTPMethod11 );
has path        => ( is => 
Flickr-API2 ( T/TJ/TJC/Flickr-API2-2.50.tar.gz, TJC, 2016; MetaCPAN )
Flickr-API2/lib/Flickr/API2/Request.pm ( view source; MetaCPAN )
ces/rest/';

    bless $self, $class;

    $self->{api_args}->{format}         = 'json';
    $self->{api_args}->{nojsoncallback} = 1;

    $self->method('POST');
    $self->uri( $self->{rest_uri} );

Catmandu-Stat ( H/HO/HOCHSTEN/Catmandu-Stat-0.13.tar.gz, HOCHSTEN, 2016; MetaCPAN )
Catmandu-Stat/lib/Catmandu/Stat.pm ( view source; MetaCPAN )
Calculate statistics on the availabity of the ISBN fields in the dataset
    cat data.json | catmandu convert JSON to Stat --fields isbn

    # Preprocess data and calculate statistics
    catmandu co
Salvation-MongoMgr ( G/GF/GFILATOV/Salvation-MongoMgr-0.06.tar.gz, GFILATOV, 2016; MetaCPAN )
Salvation-MongoMgr/lib/Salvation/MongoMgr/Connection.pm ( view source; MetaCPAN )
ion;

use utf8;
use strict;
use warnings;
use boolean;
use feature 'state';

use URI ();
use JSON 'from_json';
use File::Slurp 'read_file';
use Salvation::TC ();
use MongoDB ();


sub new {

    my ( 

    if( defined( my $auth_config_file = $self -> auth_config_file() ) ) {

        my $rv = from_json( scalar( read_file( $auth_config_file ) ) );

        Salvation::TC -> assert( $rv, sprintf( 'Has
-> { 'servers_list' } = [ $self -> { 'host' } ];

        } else {

            my $config = from_json( scalar( read_file( $self -> config_file() ) ) );

            Salvation::TC -> assert( $config, 
Net-Google-CalendarV3 ( R/RH/RHESA/Net-Google-CalendarV3-0.16.tar.gz, RHESA, 2016; MetaCPAN )
Net-Google-CalendarV3/lib/Net/Google/CalendarV3.pm ( view source; MetaCPAN )
Event );
use Net::Google::CalendarV3::Calendar;
use Net::Google::CalendarV3::Event;
use WWW::JSON;
use JSON::XS;

has authentication => is => 'ro', lazy => 1, predicate => 'has_auth', builder => '_bui
 => 1;

method _build_service {
    WWW::JSON->new( base_url         => 'https://www.googleapis.com/calendar/v3',
                    post_body_format => 'JSON',
                    ( $self->has_auth 
lf->has_token ? (authentication   => $self->authentication) : () ),
                    json             => JSON::XS->new->utf8->allow_nonref->allow_blessed->convert_blessed,
    );
}

method _build_a
Test-Mountebank ( D/DA/DAGFINNR/Test-Mountebank-0.001.tar.gz, DAGFINNR, 2016; MetaCPAN )
Test-Mountebank/lib/Test/Mountebank.pm ( view source; MetaCPAN )
 and a response
    # (Responds to URL /foobar.json, returns JSON content '{"foo":"bar"}')
    $imposter->stub->predicate(
        path   => "/foobar.json",
        method => "GET",
    )->response(
 
atus_code  => 200,
        content_type => "application/json",
        # Equivalent:
        # headers    => { Content_Type => "application/json" },
        body         => { foo => "bar" },
        #
->predicate(
        path   => "/qux/999/json",
        method => "GET",
    )->response(
        status_code  => 404,
        content_type => "application/json",
        body         => '{ "error": "
Dist-Zilla-Plugin-For-DefHash-Examples ( P/PE/PERLANCAR/Dist-Zilla-Plugin-For-DefHash-Examples-0.001.tar.gz, PERLANCAR, 2016; MetaCPAN )
Dist-Zilla-Plugin-For-DefHash-Examples/lib/Dist/Zilla/Plugin/For/DefHash/Examples.pm ( view source; MetaCPAN )
read_text);
use Hash::DefHash;
use JSON::MaybeXS;

sub munge_files {
    no strict 'refs';

    my $self = shift;

    find sub {
        return unless -f && /\.json\z/;
        my $ct = read_text $_;

        my $hash;
        eval { $hash = decode_json($ct) };
        $self->log_fatal(["File %s doesn't contain a valid JSON: %s", "$File::Find::dir/$_", $@])
            if $@;
        my $defhash;
s>). Currently it does the following:

=over

=item * For C<share/examples/*.json>, check that the file contains valid JSON and valid defhash (or invalid defhash, if filename begins with 'error-')

=b
Plack-Debugger-Panel-DBIC-QueryLog ( S/SY/SYSPETE/Plack-Debugger-Panel-DBIC-QueryLog-0.002.tar.gz, SYSPETE, 2016; MetaCPAN )
Plack-Debugger-Panel-DBIC-QueryLog/lib/Plack/Debugger/Panel/DBIC/QueryLog.pm ( view source; MetaCPAN )
atalyst::TraitFor::Model::DBIC::Schema::QueryLog::AdoptPlack>.

    use Plack::Builder;
 
    use JSON;
 
    use Plack::Debugger;
    use Plack::Debugger::Storage;
 
    use Plack::App::Debugger;
 
 
l',
            serializer   => sub { encode_json( shift ) },
            deserializer => sub { decode_json( shift ) },
            filename_fmt => "%s.json",
        ),
        panels => [
          
Test-Mountebank ( D/DA/DAGFINNR/Test-Mountebank-0.001.tar.gz, DAGFINNR, 2016; MetaCPAN )
Test-Mountebank/lib/Test/Mountebank/Client.pm ( view source; MetaCPAN )
Client;

use Moose;
our $VERSION = '0.001';
use Method::Signatures;
use HTTP::Tiny;
use JSON::Tiny qw(encode_json);
use Test::Mountebank::Imposter;

has ua => (
    is      => 'ro',
    default => sub
) {
    $self->ua->post(
        $self->mb_url . "/imposters",
        {
            headers => { "Content-Type" => "application/json" },
            content => $imp->as_json,
        },
    );
}

1;
Test-Mountebank ( D/DA/DAGFINNR/Test-Mountebank-0.001.tar.gz, DAGFINNR, 2016; MetaCPAN )
Test-Mountebank/lib/Test/Mountebank/Imposter.pm ( view source; MetaCPAN )
 Moose;
our $VERSION = '0.001';
use Method::Signatures;
use Test::Mountebank::Stub;
use JSON::Tiny qw(encode_json);
use Carp;

has protocol => ( is => 'rw', isa => 'Str', default => 'http' );
has port
[ $self->map_stubs( sub { $_->as_hashref } ) ],
        protocol => $self->protocol,
        port     => $self->port,
    };
}

method as_json() {
    return encode_json( $self->as_hashref() );
}

1;
Salvation-MongoMgr ( G/GF/GFILATOV/Salvation-MongoMgr-0.06.tar.gz, GFILATOV, 2016; MetaCPAN )
Salvation-MongoMgr/bin/mongomgr.pl ( view source; MetaCPAN )
quire Carp;

    $SIG{ __DIE__ } = \&Carp::confess;
    $SIG{ __WARN__ } = \&Carp::cluck;
};

use JSON ();
use Getopt::Long 'GetOptions';
use Salvation::TC ();
use Salvation::MongoMgr ();

use Salvati
s );
        my $json = JSON -> new() -> utf8( 1 ) -> allow_blessed( 1 );

        if( $opts -> { 'pretty' } ) {

            $json = $json -> pretty();
        }

        print( $json -> encode( $rv 
Dancer2-Plugin-SendAs ( R/RU/RUSSELLJ/Dancer2-Plugin-SendAs-0.002.tar.gz, RUSSELLJ, 2016; MetaCPAN )
Dancer2-Plugin-SendAs/lib/Dancer2/Plugin/SendAs.pm ( view source; MetaCPAN )
  get '/html' => sub {
        send_as html => template 'foo';
    };

    get '/json/**' => sub {
        send_as json => splat;
    };

=head1 DESCRIPTION

This plugin is DEPRECATED. The C<send_as> 
Catmandu-Stat ( H/HO/HOCHSTEN/Catmandu-Stat-0.13.tar.gz, HOCHSTEN, 2016; MetaCPAN )
Catmandu-Stat/lib/Catmandu/Exporter/Stat.pm ( view source; MetaCPAN )
elds in the dataset
    cat data.json | catmandu convert -v JSON to Stat --fields isbn

    # Export the statistics as YAML
    cat data.json | catmandu convert -v JSON to Stat --fields isbn --as YAML
a.json | catmandu convert JSON to Stat --fields title

    # Calculate statistics on the number of records that contain a 'title', 'isbn' or 'subject' fields
    cat data.json | catmandu convert JSON 
t data.json | catmandu convert JSON to Stat --fields foo.bar.x.y

When no fields parameter is available, then all fields are read from the first input record.

=item as Table | CSV | YAML | JSON | ...
Bot-Backbone ( H/HA/HANENKAMP/Bot-Backbone-0.161950.tar.gz, HANENKAMP, 2016; MetaCPAN )
Bot-Backbone/lib/Bot/Backbone/SendPolicy/MinimumRepeatInterval.pm ( view source; MetaCPAN )
purged of any keys that are no longer relevant.

It should be safe to save this structure using L<JSON> or L<YAML> or L<MongoDB> or L<Storable> or whatever you like and load it again, if you want the 
Net-Google-CalendarV3 ( R/RH/RHESA/Net-Google-CalendarV3-0.16.tar.gz, RHESA, 2016; MetaCPAN )
Net-Google-CalendarV3/lib/Net/Google/CalendarV3/ToJson.pm ( view source; MetaCPAN )
package Net::Google::CalendarV3::ToJson;
$Net::Google::CalendarV3::ToJson::VERSION = '0.16';
use Moose::Role;
use Kavorka;

method TO_JSON {
    return { %$self };
};

1;

Test-Mountebank ( D/DA/DAGFINNR/Test-Mountebank-0.001.tar.gz, DAGFINNR, 2016; MetaCPAN )
Test-Mountebank/lib/Test/Mountebank/Response/Is.pm ( view source; MetaCPAN )
N = '0.001';
use Method::Signatures;
use Test::Mountebank::Types qw( HTTPHeaders );
use JSON::Tiny qw(encode_json);
use File::Slurper qw/read_text/;
use Carp;
use MIME::Types;

has status_code    => (
Test-Mountebank ( D/DA/DAGFINNR/Test-Mountebank-0.001.tar.gz, DAGFINNR, 2016; MetaCPAN )
Test-Mountebank/lib/Test/Mountebank/Stub.pm ( view source; MetaCPAN )
tures;
use Test::Mountebank::Predicate::Equals;
use Test::Mountebank::Response::Is;
use JSON::Tiny qw(encode_json);
use Carp;

has predicates => (
    traits  => ['Array'],
    is      => 'ro',
    is
map_responses( sub { $_->as_hashref } ) ],
        predicates => [ $self->map_predicates( sub { $_->as_hashref } ) ],
    };
}

method as_json() {
    return encode_json( $self->as_hashref() );
}

1;
App-vaporcalc ( A/AV/AVENJ/App-vaporcalc-0.005004.tar.gz, AVENJ, 2016; MetaCPAN )
App-vaporcalc/lib/App/vaporcalc/RecipeResultSet.pm ( view source; MetaCPAN )
sub { shift->recipe->calc },
);

method TO_JSON {
  +{ recipe => $self->recipe }
}

with 'App::vaporcalc::Role::Store';

1;

=pod

=for Pod::Coverage TO_JSON

=head1 NAME

App::vaporcalc::RecipeResult
App-vaporcalc ( A/AV/AVENJ/App-vaporcalc-0.005004.tar.gz, AVENJ, 2016; MetaCPAN )
App-vaporcalc/lib/App/vaporcalc/Result.pm ( view source; MetaCPAN )
$self->flavor_total }

method TO_JSON {
  +{
    map {; 
      my ($attr, $val) = ($_, $self->$_);
      my $raw = blessed $val && $val->can('TO_JSON') ? $val->TO_JSON : $val;
      $attr => $raw
    

      flavors
    /,
  }
}

with 'App::vaporcalc::Role::Store';

1;

=pod

=for Pod::Coverage TO_JSON

=head1 NAME

App::vaporcalc::Result - A calculated App::vaporcalc::Recipe result

=head1 SYNOPSI

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