ot generated");
}
# load plugins
__PACKAGE__->load_plugins(
'Web::FillInFormLite',
'Web::JSON',
'+<% $module %>::Web::Plugin::Session',
);
# setup view
use <% $module %>::Web::View;
{
#!/usr/bin/env perl
package WebService::MyJSONs;
use 5.024000;
use warnings;
use experimental qw< signatures >;
no warnings qw< experimental::signatures >;
{ our $VERSION = '0.002' }
use Carp qw< cro
our @EXPORT_OK = map { +"myjsons_$_" }
qw< cmdline get get_json put put_json >;
our %EXPORT_TAGS = (all => [@EXPORT_OK]);
our $DEFAULT_ENDPOINT = 'https://www.myjsons.com';
sub code ($self, @ne
nd sub __dump
sub get ($self, $code = undef) {
require JSON::PP;
return JSON::PP::decode_data($self->get_json($code));
}
sub get_json ($self, $code = undef) {
$self = $self->new unless bles
VERSION = '0.09';
# Load the required Perl modules or packages.
use URI;
use LWP::UserAgent;
use JSON::PP;
# Use Inline Python module to define a function.
use Inline Python => <<'END_OF_PYTHON_CODE
transaction';
# Set the request header.
$HEADER = [Accept => 'application/json',
Content_Type => 'application/json'];
# Assemble the service url.
$SERVICE_URL_PRE = $API_URL.$API_PATH_PRE
#
# @argument $content Response content (scalar) #
# @return $json_encode Encoded content (scalar) #
# --------------------------------
my $JSON;
sub _stringify_ref {
my ($self, $ref) = @_;
if (ref $ref eq 'SCALAR' or ref $ref eq 'REF') {
my ($str) = $self->_encrefs([ $$ref ]);
return "ref($str)";
}
require JSON::Ma
ybeXS;
$JSON ||= JSON::MaybeXS->new
->ascii(1)
->canonical(1)
->allow_nonref(1)
->space_after(1)
callback
# passed to JSON: https://rt.cpan.org/Ticket/Display.html?id=54321
# -- rjbs, 2013-01-31
local *UNIVERSAL::TO_JSON = sub { "obj($_[0])" };
return '{{' . $JSON->encode($ref) . '}}'
}
4.00 qw(coloralias);
use Git::Nuggit::Log;
use Cwd qw(getcwd);
use IPC::Run3;
use File::Spec;
use JSON;
use File::Slurp qw(read_file write_file);
our @ISA = qw(Exporter);
our @EXPORT = qw(get_submodu
= shift;
my $key = shift;
my $val = shift;
$self->{cfg} = $self->load_config("config.json",{}) unless defined($self->{cfg});
return undef unless $self->{cfg};
if (defined($val))
n) {
my $raw = read_file($fn);
return $default unless $raw;
return decode_json($raw);
} else {
return $default;
}
}
sub save_config {
my $self = shift;
);
@$files = grep { $_->name ne 'xt/author/prereqs_latest.t' } @$files;
} # end unless META.json
return;
} # end prune_files
no Moose;
__PACKAGE__->meta->make_immutable;
1;
__DATA__
___[ xt/
ng a Unix-style Makefile
Writing Makefile for Win32::Locale
Writing MYMETA.yml and MYMETA.json
Acme-MetaSyntactic 1.014 (not installed)
Themed metasyntactic variables names
By Phi
File::Spec::Functions qw(catfile);
use Getopt::Std;
use HTTP::Request;
use IO::Barf qw(barf);
use JSON::XS;
use LWP::UserAgent;
use METS::Files;
use Perl6::Slurp qw(slurp);
our $VERSION = 0.04;
# Co
I for children JSON.
my $json_uri = $self->{'_kramerius_obj'}->url.'search/api/v5.0/item/uuid:'.
$object_id.'/children';
# Get JSON.
my $req = HTTP::Request->new('GET' => $json_uri);
my $r
equest($req);
my $json;
if ($res->is_success) {
$json = $res->content;
barf(catfile($dir_to_store_files, $object_id.'.json'), $json);
} else {
err "Cannot get '$json_uri' URI.",
'HT
=head1 Internal Configuration Format
Nuggit stash configuration is saved to .nuggit/stash in a JSON file containing an object as described below.
Note: This is NOT considered a user configuration
on_opts => {
schema => 'hash*',
default => {},
},
per_arg_json => {
schema => 'bool*',
},
per_arg_yaml => {
schema => 'b
meta_is_normalized => 1,
common_opts => $common_opts,
per_arg_json => $args{per_arg_json},
per_arg_yaml => $args{per_arg_yaml},
(ggls_res => $args{ggls
&&
!$is_bool && !$ospec->{is_base64} &&
!$ospec->{is_json} && !$ospec->{is_yaml} &&
!$ospec->{is_alias};
my $a
ng;
use Pod::Usage;
use Cwd qw(getcwd);
use Term::ANSIColor;
use File::Spec;
use Git::Nuggit;
use JSON;
use Data::Dumper;
=head1 SYNOPSIS
List or create branches.
To create a branch, "ngt branch BR
sts in a submodule but not in the root repository. This will also accept the following flags: --json, --all.
=item --orphan
This argument must specify a branch name and an additional flag. If no
;
my $exists_in_flag = 0;
my $missing_from_flag = 0;
my $verbose = 0;
my $show_json = 0;
my $selected_branch = undef;
my $do_branch_list = 0;
# print "nuggit_branch.pl\n";
ParseAr
se lib $FindBin::Bin.'/../lib'; # Add local lib to path
use Git::Nuggit;
use Term::ANSIColor;
use JSON;
use Data::Dumper; # DEBUG
my $opts = {
"verbose" => 0,
"ngtstrategy" => 'ref', # Origi
# Optional explicit alternative to nameless spec
"json!", # If set, output obj in JSON format (intended for usage with future UI wrapper)
ee($opts->{branch}, $opts->{branch2});
}
# Display results
if ($opts->{json}) {
say encode_json(\@objs);
} elsif ($opts->{patch}) {
foreach my $obj (@objs) {
ck
CryptoTron::ClaimReward
CryptoTron::CreateAccount
CPAN modules:
URI
LWP::UserAgent
JSON::PP
Try::Catch
Inline::Python
Bitcoin::Crypto::Base58
=head1 AUTHOR
Dr. Peter Netz, E<lt>
.
=cut
use Carp;
use Crypt::CBC;
use Digest::SHA qw(hmac_sha256_base64 sha256);
use Encode;
use JSON::MaybeXS;
use MIME::Base64;
use String::Compare::ConstantTime;
use YAML::XS;
our $VERSION = '1.1
_secret(@_)); ## nocritic
};
=head2 $self->encrypt_data(data => $data)
Serialize I<$data> to JSON, encrypt it, and encode as base64. Also compute HMAC
code for the encrypted data. Returns hash re
my $json = JSON::MaybeXS->new;
sub encrypt_data {
my ($self, %args) = @_;
croak "data argument is required and must be a reference" unless $args{data} and ref $args{data};
my $json_data
te;
use Moose;
extends 'App::Config::Chronicle::Node';
use namespace::autoclean;
use Encode;
use JSON::MaybeXS;
use MooseX::Types -declare => ['LongStr'];
use Moose::Util::TypeConstraints;
use Synta
_json_string} //= $def->{isa} eq 'json_string' ? 1 : 0;
if ($self->{_json_string}) {
try { $value = JSON::MaybeXS->new->decode($value) } catch ($e) {
die "Couldn't decode JSON
o reload
confguration as needed
=head2 $self->encrypt_data(data => $data)
Serialize I<$data> to JSON, encrypt it, and encode as base64. Also compute HMAC
code for the encrypted data. Returns hash re
pt_data>. First checks HMAC code for data.
If data was not tampered, decrypts it and decodes from JSON. Returns data, or
undef if decryption failed.
=head2 $self->encrypt_payload(data => $data)
Enc
structures, scalars, and references provided that the data can be serialized
as an attribute on a JSON document.
=head2 $self->decrypt_payload(value => $value)
Accepts payload encrypted with I<encry
root directory, or a user-specified folder relative to it.
Aliases are defined in .nuggit/config.json as the "aliases" object, or via the NGT_ALIASES environment variable. At present, this file must
the shell if the command exits without an error.
=back
=head1 EXAMPLE
Define a .nuggit.config.json file containing
{
"aliases" : {
"dkrbuild" : "docker run -it -v ${PWD}:/src:delegate
--uno | -u
Ignore untracked files
=item --ignored
Show ignored files
=item --json
Show raw status structure in JSON format.
=item --conflicts | -c
Filter status output to show submodule summari
my $verbose = 0;
my $do_dump = 0; # Output Dumper() of raw status (debug-only)
my $do_json = 0; # Output in JSON format
my $flags = {
"uno" => 0, # If set, ignore untracked objects (git
u!" => \$flags->{uno},
"ignored!" => \$flags->{ignored},
'dump' => \$do_dump,
'json' => \$do_json,
'all|a!' => \$flags->{all},
'details|d!' => \$flags->{details},
'conflicts|c'
ge-tree command, with added submodule recursion.
=head1 Options
=over 4
=item B<--json>
Output results in a JSON format for parsing, or piping to a future UI. This implies '--full'
=item B<--full
warnings;
use parent qw( cPanel::APIClient::Request::HTTPBase );
use cPanel::APIClient::Utils::JSON ();
use cPanel::APIClient::Response::WHM1 ();
sub HTTP_RESPONSE_CLASS { return 'cPanel::APICl
bless [ $func, $args_hr ], $class;
}
sub get_http_url_path {
my ($self) = @_;
return "/json-api/$self->[0]";
}
sub get_http_payload {
my ($self) = @_;
local $self->[1]{'api.versio
lient::Utils::CLIRequest;
return (
'/usr/local/cpanel/bin/whmapi1',
'--output=json',
( $username ? "--user=$username" : () ),
$self->[0],
cPanel::APIClient: