rom Data::Context::Actions
file_suffixes HASHREF
json => '.dc.json' : JSON::XS
js => '.dc.js' : JSON::XS->relaxed
yaml => '.dc.yml' : YAML or YAML::XS
h) is
my/config/file.dc.js
my/config/file.dc.json
my/config/file.dc.yml
my/config/file.dc.xml
my/config/_default.dc.js
my/config/_default.dc.json
my/config/_default.dc.yml
my/config/_default.
xes will be used for loading the
various config types. Default:
{
js => '.dc.js',
json => '.dc.json',
yaml => '.dc.yml',
xml => '.dc.xml',
}
=item file_suffix_order
Specify the ord
fault => sub {
return {
json => {
suffix => '.dc.json',
module => 'Data::Context::Loader::File::JSON',
},
js => {
is => 'rw',
isa => 'ArrayRefStr',
coerce => 1,
default => sub { [qw/js json yaml xml/] },
);
has default => (
is => 'rw',
isa => 'Str',
default => '_def
erer',
'Dist::Zilla::Role::BuildRunner',
);
use Dist::Zilla::File::FromCode;
use Qgoda;
use JSON 2;
use Path::Class;
use File::ShareDir;
use Cwd;
has 'language' => (
is => 'rw',
lazy =
self) = @_;
$self->add_file(Dist::Zilla::File::FromCode->new({
name => file('package.json') . '',
code => sub {
my $package = {};
$package->{$_} = $self->$
a = $package->{qgoda} = {};
$qgoda->{language} = $self->language;
return JSON->new->utf8(1)->pretty(1)->encode($package)
}
}));
}
sub convert_versions {
my ($
=head1 Dist-Zilla-Plugin-Qgoda
A L<plug-in> that generates the C<package.json> of a
LL<http://www.qgoda.net/> plug-in.
=head2 DESCRIPTION
See https://metacpan.org/pod/Dist::Zilla::Plugin::Qgoda.
=
s->ua->post( $s->baseURL().'/api/v1/auth', {Accept => '*/*'}, json => $params );
my $json = _handleResponse($tx);
return $json if $json->{error};
my $cookies = $tx->res->cookies;
my $sessionC
y ($ua, $tx) = @_;
$tx->req->headers->header('X-CSRF-Token' => $csrfHeader);
});
return $json;
}
=head3 loginActive
=cut
sub loginActive($s) {
my $tx = $s->ua->get( $s->baseURL().'/api/v
b ssnAdd($s, $params) {
my $tx = $s->ua->post( $s->baseURL().'/api/v1/ssns', {Accept => '*/*'}, json => $params );
return _handleResponse($tx);
}
=head3 ssnGet
See Hetula API doc for endpoint GE
package EPFL::Sciper::List;
use 5.006;
use strict;
use warnings;
use JSON;
use Readonly;
use LWP::UserAgent;
=head1 NAME
EPFL::Sciper::List - Retrieve a list of all public active sciper from EPFL.
sciper from EPFL
use EPFL::Sciper::List qw/retrieveSciper toJson toTsv/;
my @listPersons = retrieveSciper();
print toJson(@listPersons);
print toTsv(@listPersons);
Via the command l
retrieveSciper toJson toTsv/;
Readonly::Scalar my $TIMEOUT => 1200;
Readonly::Scalar my $MAXREDIRECT => 10;
Readonly::Scalar my $AUTOCOMPLETE_URL =>
'https://search.epfl.ch/json/autocompletename
le version 0.3
=head1 SYNOPSIS
use Data::Context::Loader::File;
# Load a file of relaxed json type
my $file = Data::Context::Loader::File->new(
file => '/path/config.dc.js',
use strict;
package DAPNET::API;
use LWP::UserAgent;
use JSON;
use MIME::Base64;
#use LWP::ConsoleLogger::Everywhere ();
=head1 NAME
DAPNET::API - Use the DAPNET API from Perl
=head1 SYNOPSIS
my
ength($self->{CALLSIGN});
return($self);
};
sub _build_request {
my($self) = shift;
my($json) = shift;
my($type) = shift;
my($username) = $self->{DAPNET_USERNAME};
my($pw) = $sel
=> 'application/json',
'Authorization'=>'Basic ' . encode_base64($username.':'.$pw)
);
$req->content( $json );
return($req);
};
sub _json_individual_cal
ext::Manual
=head1 SYNOPSIS
# The config files (all produce the same data structures)
# JSON relaxed : data.dc.js
{
# shell/perl style comments ok
"PARENT": "other/path",
odule",
"METHOD" : "my_action",
},
},
}
# JSON strict : data.dc.json
{
"PARENT": "other/path",
"hash" : {
"key" : "value"
:Context> is it's simple handling of many configuration
files. It supports configuration files in JSON format (strict & relaxed
variants), YAML and XML (via XML::Simple). Basically the aim is to suppo
use strict;
use warnings;
use version;
use Text::ANSITable;
use JSON;
use DBI;
use DBD::SQLite;
our $VERSION = '0.05';
our $Json = JSON->new;
sub _sqlite_type_from_sth_ix {
my ($dbh, $sth, $ix)
$row, $ix) = @_;
return unless defined $ix;
return unless defined $row->[ $ix ];
my $h = $Json->decode( $row->[ $ix ] );
return unless 'HASH' eq ref( $h );
delete @$h{ grep !defined($h->
execute();
my $t = Text::ANSITable::SQLStyleSheet->from_sth($sth, q{
SELECT
*,
JSON_OBJECT(
'fgcolor',
PRINTF(
'%02x%02x%02x',
ABS(RANDOM()) % 25
CT: resultset for Net::SMTP::Verify checks
use Net::SMTP::Verify::Result;
use Data::Dumper;
use JSON;
has 'results' => (
is => 'ro', isa => 'HashRef[Net::SMTP::Verify::Result]', lazy => 1,
def
ft;
print Dumper $self->entries;
return;
}
sub dump_json {
my $self = shift;
foreach my $rcpt ( $self->entries ) {
print to_json { %$rcpt }, {
pretty => 1,
};
}
return;
}
d in the array.
=head2 dump()
Output all results with Data::Dumper.
=head2 dump_json()
Output all results as JSON.
=head2 print_text()
Output all results as text.
=head2 is_all_success()
Retur
JSON::XS;
our $VERSION = version->new('0.3');
extends 'Data::Context::Loader::File';
has '+module' => (
default => 'JSON::XS',
);
sub loader {
my ($self, $file) = @_;
return JSON:
=head1 DESCRIPTION
=head1 SUBROUTINES/METHODS
=head2 C<loader ($file)>
Loads the file as loose JSON
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND ENVIRONMENT
=head1 DEPENDENCIES
=head1 INCOMPATIB
n one bulk
when PIPELINING (default 10)
-j --json output JSON
=head1 SEE ALSO
Perl class interface L<Net::SMTP::Verify>
=cut
use Net::SMTP
k when PIPELINING (default 10)',
);
has 'json' => (
is => 'rw', isa => 'Bool',
traits => [ 'Getopt' ],
cmd_aliases => 'j',
documentation => 'output JSON',
);
has '+resolver' => ( traits => [
my $rs = $self->check( $self->size, $self->from, @{$self->extra_argv} );
if( $self->json ) {
$rs->dump_json;
} else {
$rs->print_text;
}
return;
}
1;
__END__
=pod
=encoding UTF-8
not work. Please notify mbethke@cpan.org');
$ua->default_header( 'Accept' => 'application/json' );
$self->{ua} = $ua;
}
# uncoverable condition false
# uncoverable branch r
ic 304 0 /img/octalfutures.png
[Thu Feb 18 13:56:09 2016] [debug] GET "/dyngrp/11/pvscat.json"
=head1 DESCRIPTION
L<Mojolicious::Plugin::StaticLog> is a L<Mojolicious> plugin which will log
d_file write_file/;
use IO::Prompter [ -style => 'bold', '-stdio', '-verbatim' ];
use JSON::MaybeXS qw/encode_json/;
use PerlX::Maybe;
use Term::ANSIColor qw/RED RESET/;
use constant LEVEL_VALUES =>
,
maybe versource => $versource,
maybe verformat => $verformat,
);
$options{tests} = encode_json \@tests if @tests;
db->insert(problems => \%options);
db->insert(contest_problems => {problem =
use Exporter 'import';
use POSIX qw(strftime);
use Data::ICal::Entry::Event;
use Date::ICal;
use JSON::PP;
our @EXPORT_OK = qw(meetup_to_icalendar get_meetup_event_uid);
our $VERSION = '0.02';
=hea
icipants => {
$me => {
email => $me,
scheduleRSVP => $JSON::PP::true,
scheduleStatus => 'needs-action',
#roles => ['attendee
},
);
=head2 C<< ->json >>
Used to set/get the L<JSON::XS> JSON decoder
=cut
has 'json' => (
is => 'lazy',
default => sub {
require JSON::XS;
JSON::XS->new()->utf8
}
tions ) >>
$m->read_credentials();
Looks for a file named C<meetup.credentials>, parses it as JSON and reads
the value C<applicationKey> from it.
The following options are recognized:
=over 4
=
"Couldn't read API key from '$options{ filename }' : $!";
local $/; # /
my $cfg = $self->json->decode(<$fh>);
$self->{api_key} = $cfg->{applicationKey}
}
=head2 C<< ->request( $method, $
shift;
$o->{xml2json_options} = shift;
$o->{xml2json_options} =
{ content_key => 'text', pretty => 1, attribute_prefix => 'attr_' }
if not defined $o->{xml2json_options};
$o->{
icket_owner {
my ( $self, $ticket_id, $new_owner_id ) = @_;
my $content_key = $self->{xml2json_options}{content_key};
my $old_data = $self->get_ticket_hash($ticket_id);
$self->put(
}
sub filter_fields {
my ( $self, $a ) = @_; # array of hashes
my $key = $self->{xml2json_options}{content_key};
for my $j (@$a) {
$j = { map { $_ => $j->{$_}{$key} }