ret;
goto &d;
}
# JSON Dumper
sub jd {
my $ret = $_[-1] eq '_Devel::Kit_return' ? 1 : 0;
@_ = _at_setup(
'JSON::Syck',
sub {
eval { JSON::Syck::Load( $_[0] );
YAML dumper
perl -MDevel::Kit -e 'yd($your_yaml_here)'
=head4 jd() JSON dumper
perl -MDevel::Kit -e 'jd($your_json_here)'
=head4 xd() XML dumper
perl -MDevel::Kit -e 'xd($your_xml_he
and what not:
=over 4
=item L<Data::Dumper>
=item L<File::Slurp>
=item L<YAML::Syck>
=item L<JSON::Syck>
=item L<XML::Parser>
=item L<Storable>
=item L<Data::MessagePack>
=item L<Digest::MD5>
ings;
use autodie;
use 5.010001;
use Carp qw();
use Graph;
use IO::Zlib;
use IPC::Cmd qw();
use JSON qw();
use List::Util;
use Path::Tiny qw();
use Statistics::Descriptive qw();
use YAML::Syck qw();
pod t psgi/]) { return 'perl' }
when([qw/css/]) { return 'css' }
when([qw/js json/]) { return 'javascript' }
when([qw/c cpp h/]) { return 'clike' }
when([qw/py
$opt->{outfile} ) {
$opt->{outfile} = Path::Tiny::path( $args->[0] )->absolute . ".cover.json";
}
}
sub execute {
my ( $self, $opt, $args ) = @_;
# make paths absolute before we
$tempdir->child("meta.cover.json")
->spew( JSON::to_json( $meta_of, { pretty => 1, canonical => 1, } ) );
$tempdir->child("meta.cover.json")->copy( $opt->{outfile} );
ft; goto &Cwd::cwd }
};
# TODO: sort out conf file methods (or Config::Any etc):
# read_json
# write_json
#### same RSS/time as redefine-self plus 3.5% more ops ##
# sub cwd {
# require Cwd;
e;
};
};
Sub::Defer::defer_sub __PACKAGE__ . '::json_write' => sub {
require JSON::Syck;
return sub {
shift;
goto &JSON::Syck::DumpFile; # already does ♥ inst
e)
};
};
Sub::Defer::defer_sub __PACKAGE__ . '::json_read' => sub {
require JSON::Syck;
return sub {
shift;
goto &JSON::Syck::LoadFile;
};
};
sub is_safe_part {
m
}
sub _resume_info_path
{
my ($self) = @_;
return $self->_url_basename . '.mdown-resume.json';
}
1;
__END__
=pod
=encoding UTF-8
=head1 VERSION
version 0.0.13
=for :stopwords cpan tes
= '0.0401';
use strict;
use warnings;
use 5.012;
use LWP::UserAgent;
use URI;
use JSON::MaybeXS qw(encode_json);
sub notify
{
my $class = shift;
my ($args) = @_;
my $base_url = $arg
if ( defined($msg) )
{
push @$query,
( text_params => scalar( encode_json( { msg => $msg, } ) ) );
}
$url->query_form($query);
my $response = $ua->get($url);
P::UserAgent;
use subs 'timeout';
use Class::Tiny qw(room_webhook_url _ua timeout);
use Carp;
use JSON;
use Try::Tiny;
use Data::Validate::URI qw(is_uri);
BEGIN {
our $VERSION = '0.3';
}
my $
ft;
my $msg_json = "{\"text\": \"$msg\"}";
my $req = HTTP::Request->new('POST', $self->room_webhook_url);
$req->header('Content-Type' => 'application/json');
$req->content($msg_json);
my $respon
if($response->is_error)
{
my $content = $response->decoded_content();
my $json;
try
{
$json = decode_json($content);
};
my $error_message = $response->code." ".$response->message;
t
};
};
Sub::Defer::defer_sub __PACKAGE__ . '::json_to_ref' => sub {
require JSON::Syck;
return sub {
shift;
goto &JSON::Syck::Load; # already does ♥ i
};
};
Sub::Defer::defer_sub __PACKAGE__ . '::ref_to_json' => sub {
require JSON::Syck;
return sub {
shift;
goto &JSON::Syck::Dump; # already does ♥ inst
sub ref_to_jsonp {
my ( $app, $ref, $function ) = @_;
$function ||= 'jsonp_callback';
return if $function =~ m/[^0-9a-zA-Z_]/;
return $function . '(' . $app->ref_to_json($ref) . ');'
=back
=head2 Planned additional drivers
=over
=item *
SSH/SFTP
=item *
IMAP
=item *
JSON/YAML files (i.e. browse data structure)
=item *
Zip/archive
=item *
Multipart/MIME
=back
$rv = {};
} else {
Carp::confess $res->message;
}
} else {
$rv = $res->json;
}
return $rv;
}
sub _parent_reference ($self) {
my %rv;
if ($self->{metadata}) {
elete($self->url);
Carp::confess $res->message if $res->is_error;
$self->_set_metadata($res->json);
return $self;
}
1;
=encoding utf8
=head1 NAME
Nuvol::Office365::Item - Internal methods
ent->url('children'), json => {name => $folder, folder => {}});
Carp::confess $res->message if $res->is_error;
$parent = Nuvol::Item->new($drive, {metadata => $res->json});
}
$self->_set_
$self->url('create_folder_v2'),
json => {path => $self->realpath->to_route});
Carp::confess $res->message if $res->is_error;
$self->_set_metadata($res->json->{metadata});
return $self;
}
o;
use strict;
use warnings;
use 5.010;
use Carp;
use autodie;
use utf8;
use Moo;
use JSON;
extends qw/Zabbix2::API::CRUDE/;
sub id {
## mutator for id
my ($self, $value) = @
$self->id ],
globalmacro => $self->globalp ? JSON::true : JSON::false,
$self->_extension })->[0];
cro
lf->id],
globalmacro => $self->globalp ? JSON::true : JSON::false,
countOutput => 1 });
retur
rm => \%form)->result;
die color_error $res->message if $res->is_error;
my $response = $res->json;
say_ok 'ok';
return $response;
}
sub _auth_headers ($self, $headers = {}) {
my $access_t
rm)->result;
Carp::confess $res->message if $res->is_error;
$self->_set_token($config, $res->json);
return $self;
}
1;
=encoding utf8
=head1 NAME
Nuvol::Connector - Base class for Nuvol co
blessed/;
use Module::Loaded;
use Module::Load;
use Params::Validate qw/validate :types/;
use JSON;
use LWP::UserAgent;
use Log::Any;
our $VERSION = '0.014';
has 'server' => (is => 'ro',
'Content-Type' => 'application/json-rpc',
Content => encode_json({
jsonrpc => '2.0',
$error, $response->code, $response->message);
}
my $decoded = eval { decode_json($response->decoded_content) };
if (my $error = $@) {
# no good either
cr
ct;
use Encode;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use Carp;
use LWP::UserAgent;
use JSON::XS;
use File::Temp;
use URI::Escape;
Archive::Zip::setErrorHandler(sub{});
our (@ISA, @EXPORT_
(5);
my $Response = $ua->post( $Url, {gems => join ",",@$Gems});
my $Result;
return decode_json( $Response->decoded_content ) if $Response->is_success;
die $Response->status_line;
}
# EXTRAC
or later);
Unicode::Normalize (v1.25 or later);
Archive::Zip
Encode;
Carp;
LWP::UserAgent;
JSON::XS;
File::Temp;
=head1 SCRIPTS
=head2 plagiarism_check.pl - checks your ebook againts known t
is_nullable => 1 },
"auth_key",
{ data_type => "varchar", is_nullable => 0, size => 128 },
"json_data",
{ data_type => "text", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("id");
__PACK
my $json = encode_json_ascii($data) or die "unknown error serializing to json";
$self->json_data($json)
}
sub _deserialize_action_data {
my $self = shift;
my $json = $self->json_data or r
eturn {};
my $data = decode_json_ascii($json) or die "unknown error occured deserializing json_data";
(ref($data)||'') eq 'HASH' or die "Bad action data - did not deserialize to a HashRef";
package Nuvol::Dropbox::Item;
use Mojo::Base -role, -signatures;
use Mojo::JSON 'to_json';
use constant SERVICE => 'Dropbox';
# internal methods
sub _build_realpath ($self) {
return $self->{path
&& $metadata->{id};
}
sub _dropbox_header ($self, %params) {
my %rv = ('Dropbox-API-Arg' => to_json(\%params));
return %rv;
}
sub _get_description ($self) {
return join ' ', SERVICE, $self->t
t_metadata'), json => \%params);
if ($res->is_error) {
if ($res->code == 409) {
$rv = {};
} else {
Carp::confess $res->message;
}
} else {
$rv = $res->json;
}
retu
/get_current_account'));
Carp::confess $res->message if $res->is_error;
my $metadata = $res->json;
$metadata->{id} = $metadata->{account_id};
return $metadata;
}
sub _update_token ($self, $