Group
Extension

Matches 35358

Data-Format-Pretty-JSON ( P/PE/PERLANCAR/Data-Format-Pretty-JSON-0.12.tar.gz, PERLANCAR, 2016; MetaCPAN )
Data-Format-Pretty-JSON/lib/Data/Format/Pretty/CompactJSON.pm ( view source; MetaCPAN )
actJSON;

use 5.010;
use strict;
use warnings;

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(format_pretty);

our $VERSION = '0.12'; # VERSION

sub content_type { "application/json" 
ata, $opts) = @_;
    state $json;

    $opts //= {};

    if ($opts->{color} // $ENV{COLOR} // (-t STDOUT)) {
        require JSON::Color;
        JSON::Color::encode_json($data, {pretty=>0, linum=>0
});
    } else {
        if (!$json) {
            require JSON::MaybeXS;
            $json = JSON::MaybeXS->new->utf8->allow_nonref;
        }
        $json->encode($data);
    }
}

1;
# ABSTRACT: Pr
TOML ( K/KA/KARUPA/TOML-0.97.tar.gz, KARUPA, 2016; MetaCPAN )
TOML/lib/TOML.pm ( view source; MetaCPAN )
 ); # SvTYPE is IV or NV?

    my $type = ref($value);
    if (!$type) {
        return string_to_json($value);
    } elsif ($type eq 'ARRAY') {
        return sprintf('[%s]', join(", ", map { _serial
\f',
    "\b" => '\b',
    "\"" => '\"',
    "\\" => '\\\\',
    "\'" => '\\\'',
);
sub string_to_json {
    my ($arg) = @_;

    $arg =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/g;
    $arg =~ s/([\x00-\x08
WebService-TDWTF ( M/MG/MGV/WebService-TDWTF-0.003.tar.gz, MGV, 2016; MetaCPAN )
WebService-TDWTF/lib/WebService/TDWTF.pm ( view source; MetaCPAN )
00;
use strict;
use warnings;
use parent qw/Exporter/;

use Carp;
use HTTP::Tiny;
use JSON::MaybeXS qw/decode_json/;
use Scalar::Util qw/looks_like_number/;
use WebService::TDWTF::Article;

my @subs =
nse = $ht->get($url);
	croak $response->{reason} unless $response->{success};
	$response = decode_json $response->{content};
	croak $response->{Status} if ref $response eq 'HASH' && !exists $response-
Text-CSV-Flatten ( T/TK/TKLUCK/Text-CSV-Flatten-0.04.tar.gz, TKLUCK, 2016; MetaCPAN )
Text-CSV-Flatten/lib/Text/CSV/Flatten.pm ( view source; MetaCPAN )
e Text::CSV::Flatten;

use v5.014;
use strict;
use warnings;

our $VERSION = '0.04';

use JSON qw/ encode_json /;
use Text::CSV;

my @KNOWN_ARGS= qw/ column_name /;

sub new {
    my ($class, $pattern
   } elsif($it->can('TO_JSON')) {
        no warnings 'prototype';            # avoid "_foreach() called too early to check prototype"
        _foreach($codeblock, $it->TO_JSON);
    } else {
        
ror";
        }
    } else {
        my $cell_value= ref $cur_data
                      ? encode_json($cur_data)
                      : $cur_data;
        my @column_tuple= @$column_name_prefix ? @$
Dist-Zilla-Plugin-OptionalFeature ( E/ET/ETHER/Dist-Zilla-Plugin-OptionalFeature-0.023.tar.gz, ETHER, 2016; MetaCPAN )
Dist-Zilla-Plugin-OptionalFeature/lib/Dist/Zilla/Plugin/OptionalFeature.pm ( view source; MetaCPAN )
pan-meta/issues/28
    # but this is the current v2.0 spec - regexp lifted from Test::CPAN::Meta::JSON::Version
    $self->log_fatal('invalid syntax for optional feature name \'' .  $self->name . '\''
Graph-Dijkstra ( D/DD/DDALLEN/Graph-Dijkstra-0.70.tar.gz, DDALLEN, 2016; MetaCPAN )
Graph-Dijkstra/lib/Graph/Dijkstra.pm ( view source; MetaCPAN )
##########
#JSON Graph Specification file format methods                               #
#############################################################################
{ 
		
	use JSON;

	sub inp

		}
		
		my $json_text = $EMPTY_STRING;
		open(my $infile, '<:encoding(UTF-8)', $filename) or croak "could not open '$filename'";
		
		print  {$verboseOutfile} "inputGraphfromJSON: opened '$file
y $line = <$infile>) {
			$json_text .= $line;
		}
		close($infile);
	
		my $graphHref = from_json( $json_text, {utf8 => 1} ) or croak "inputGraphfromJSON: invalid json text";
		
		if (ref($gra
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Partner.pod ( view source; MetaCPAN )
to use when encrypting the JSON data being sent to the
Pandora API method.

=item decryption_key =E<gt> STRING [required]

The decryption key to use when decrypting the JSON data send back from the
Pa
Net-Google-Analytics ( N/NW/NWELLNHOF/Net-Google-Analytics-3.05.tar.gz, NWELLNHOF, 2016; MetaCPAN )
Net-Google-Analytics/lib/Net/Google/Analytics/OAuth2.pm ( view source; MetaCPAN )
h2::VERSION = '3.05';
use strict;
use warnings;

# ABSTRACT: OAuth2 for Google Analytics API

use JSON;
use LWP::UserAgent;
use URI;

sub new {
    my $class = shift;
    my $self  = { @_ };

    die(
;

    die('error getting token: ' . $res->status_line) unless $res->is_success;

    return from_json($res->decoded_content);
}

sub refresh_access_token {
    my ($self, $refresh_token) = @_;

    m
;

    die('error getting token: ' . $res->status_line) unless $res->is_success;

    return from_json($res->decoded_content);
}

sub interactive {
    my $self = shift;

    my $url = $self->authoriz
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora.pod ( view source; MetaCPAN )
N

B<WebService::Pandora> is a module to communicate with the Pandora (L<http://www.pandora.com>) JSON API.
The API is not officially published, and has a few oddities, but was reverse engineered and 
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora.pm ( view source; MetaCPAN )
e::Pandora::Method;
use WebService::Pandora::Cryptor;
use WebService::Pandora::Partner::iOS;

use JSON;
use Data::Dumper;

our $VERSION = '0.4';

### constructor ###

sub new {

    my $caller = shift
deExtendedAttributes'};

    $includeExtendedAttributes = ( $includeExtendedAttributes ) ? JSON::true() : JSON::false();

    # make sure they provided a stationToken argument
    if ( !defined( $stat
Positive must be specified.' );
        return;
    }

    $isPositive = ( $isPositive ) ? JSON::true() : JSON::false();

    # create the station.addFeedback method w/ appropriate params
    my $meth
Mojolicious-Plugin-Pingen ( O/OE/OETIKER/Mojolicious-Plugin-Pingen-0.2.3.tar.gz, OETIKER, 2016; MetaCPAN )
Mojolicious-Plugin-Pingen/lib/Mojolicious/Plugin/Pingen.pm ( view source; MetaCPAN )
Mojolicious::Plugin::Pingen;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::UserAgent;
use Mojo::JSON;
use POSIX qw(strftime);
use Mojo::Exception;
use constant DEBUG => $ENV{MOJO_PINGEN_DEBUG} || 0;
d2 pingen.document.upload

    my $json =   $c->pingen->document->upload($asset[,\%args]);
    $c->pingen->document->upload($mojoUpload[,\%args], sub { my ($c, $json) = @_; });

Upload a L<Mojo::Uploa
DF file). Pingen will analyze the content of the pdf and figure out
how and where to mail it.

C<$json> is the response object from  pingen.

C<%args> can contain the following optional parameters:

=
Net-Google-Analytics ( N/NW/NWELLNHOF/Net-Google-Analytics-3.05.tar.gz, NWELLNHOF, 2016; MetaCPAN )
Net-Google-Analytics/lib/Net/Google/Analytics.pm ( view source; MetaCPAN )
rict;
use warnings;

# ABSTRACT: Simple interface to the Google Analytics Core Reporting API

use JSON;
use LWP::UserAgent;
use Net::Google::Analytics::Request;
use Net::Google::Analytics::Response;
u
http_res->decoded_content);
        return $res;
    }

    my $json = from_json($http_res->decoded_content);
    $res->_parse_json($json);

    $res->start_index($start_index);
    $res->is_success(1
WebService-TDWTF ( M/MG/MGV/WebService-TDWTF-0.003.tar.gz, MGV, 2016; MetaCPAN )
WebService-TDWTF/lib/WebService/TDWTF/Article.pm ( view source; MetaCPAN )
L<WebService::TDWTF>. Each such object is guaranteed to
be a blessed hashref corresponding to the JSON returned by the TDWTF
API (possibly with some extra keys), so the data inside can be
obtained by 
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Cryptor.pod ( view source; MetaCPAN )
::Cryptor> is used to encrypt and decrypt the data sent to and from
the Pandora JSON API.  Some methods require the JSON to be sent using the Blowfish
algorithm in ECB mode.  Some of the attributes re
is passed
a true value for the B<encrypt> boolean, it uses this module to do so for the submitted
JSON data.

=head1 CONSTRUCTOR

=head2 new

Creates a B<WebService::Pandora::Cryptor> object with the 
encrypted string of the JSON data given that the Pandora
API expects, using the provided B<encryption_key> specified in the constructor.

  $encrypted = $cryptor->encrypt( $json_str );

=head2 decrypt
Net-Google-Analytics ( N/NW/NWELLNHOF/Net-Google-Analytics-3.05.tar.gz, NWELLNHOF, 2016; MetaCPAN )
Net-Google-Analytics/lib/Net/Google/Analytics/Response.pm ( view source; MetaCPAN )
}

sub _parse_json {
    my ($self, $json) = @_;

    $self->items_per_page($json->{itemsPerPage});
    $self->total_results($json->{totalResults});
    $self->contains_sampled_data($json->{containsSa
a});
    $self->profile_info($json->{profileInfo});

    my $json_totals = $json->{totalsForAllResults};
    my %totals;

    while (my ($json_name, $total) = each(%$json_totals)) {
        my $column
al;
    }

    $self->_totals(\%totals);

    my @column_headers;

    for my $column_header (@{ $json->{columnHeaders} }) {
        push(@column_headers, {
            name        => _parse_column_na
WebService-FritzBox ( R/RC/RCL/WebService-FritzBox-0.01.tar.gz, RCL, 2016; MetaCPAN )
WebService-FritzBox/lib/WebService/FritzBox.pm ( view source; MetaCPAN )
 WebService::FritzBox;
# ABSTRACT: Interface to FritzBox devices
use Digest::MD5 qw/md5_hex/;
use JSON::MaybeXS;
use LWP::UserAgent;
use Log::Log4perl;
use Moose;
use MooseX::Params::Validate;
use Try
ata = decode_json( $response->decoded_content );
        # It's just an array with one element...
        $data = $data->[0];
    }catch{
        $self->log->logdie( "Could not decode json: $_" );
   
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Method.pod ( view source; MetaCPAN )
or() );

=head1 DESCRIPTION

B<WebService::Pandora::Method> is a module which queries the Pandora JSON API using the
B<LWP::UserAgent> and B<HTTP::Request> libraries.  It is used by the main B<WebServ
dule for all of the webservice methods it exposes.  It handles all of the encryption,
decryption, JSON conversion, and the Pandora API oddities for you.

=head1 CONSTRUCTOR

=head2 new

Creates a new 
iven.  The method can
then be B<execute()>ed, returning a decrypted hashref representation of the JSON string returned
by the Pandora API method.

  $method = WebService::Pandora::Method->new( name =>
Spek ( M/ME/MELEZHIK/Spek-0.0.9.tar.gz, MELEZHIK, 2016; MetaCPAN )
Spek/README.pod ( view source; MetaCPAN )
es> documentation to know more about swat meta stories.


=head1 Advanced usage


=head2 handling json responses

Modify Kelp controller


=head3 GET /user/id

    $ cat user/id/get.pm
    
    my ($s
$id}->{age}
    }

Add json handler to swat test:

    $ cat user/id/get.handler
    
    my $headers   = shift;
    my $body      = shift;
    use JSON;
    $hash = decode_json($body);
    return "$h
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Method.pm ( view source; MetaCPAN )
ice::Pandora::Method;

use strict;
use warnings;

use WebService::Pandora::Cryptor;

use URI;
use JSON;
use HTTP::Request;
use LWP::UserAgent;
use Data::Dumper;

### constructor ###

sub new {

    my
 = LWP::UserAgent->new( timeout => $self->{'timeout'} );

    # create and store json object
    $self->{'json'} = JSON->new();

    return $self;
}

### getters/setters ###

sub error {

    my ( $se
.' );
        return;
    }

    # craft the json data accordingly
    my $json_data = {};

    if ( defined( $self->{'userAuthToken'} ) ) {

        $json_data->{'userAuthToken'} = $self->{'userAuthT
Metabase-Client-Simple ( D/DA/DAGOLDEN/Metabase-Client-Simple-0.012.tar.gz, DAGOLDEN, 2016; MetaCPAN )
Metabase-Client-Simple/lib/Metabase/Client/Simple.pm ( view source; MetaCPAN )
ient::Simple;
# ABSTRACT: a client that submits to Metabase servers

our $VERSION = '0.012';

use JSON::MaybeXS;
use HTTP::Tiny 0.056; # can_ssl
use URI;

my @valid_args;

BEGIN {
    @valid_args = qw
=> {
                Content_Type => 'application/json',
                Accept       => 'application/json',
            },
            content => JSON::MaybeXS->new( { ascii => 1 } )->encode( $fact->
=> {
                Content_Type => 'application/json',
                Accept       => 'application/json',
            },
            content => JSON::MaybeXS->new( { ascii => 1 } )
              ->

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