trict, -signatures, -async_await;
use Mojo::Promise;
use Mojo::IOLoop;
use Mojo::JSON qw/ true false from_json to_json /;
use Syntax::Keyword::Try;
use Text::Trim 'trim';
use Data::GUID::URLSafe;
use
ne_line eqq belongs_to trim true false
unique_id hashify next_tick_p sleep_p
encode_json decode_json
/;
our %EXPORT_TAGS = (bool => [qw/ true false /]);
our $VERSION = "v0.0.36";
sub make_on
ub {
$p->resolve();
});
return $p;
}
sub encode_json :prototype(_) ($data) { encode_utf8 to_json $data }
sub decode_json :prototype(_) ($bytes) { from_json decode_utf8 $bytes }
1;
package Devel::Camelcadedb;
# must be quoted to work correctly with JSON protocol
our $VERSION = "v2023.1"; # DO NOT REMOVE FUCKING v, IT KEEPS PROPER VERSIONING
# to ensure protocol compatibility be
my $_debug_socket;
my $_debug_packed_address;
my IO::Select $_debug_socket_select;
my $coder; # JSON::XS coder
my $deparser; # B::Deparse deparser
my $frame_prefix_step = " ";
my $frame_prefix = '
line_number) = @_;
return $line_number - 1;
}
#@returns JSON::XS
sub _get_seraizlier
{
unless ($coder)
{
$coder = JSON::XS->new();
$coder->latin1();
}
return $code
$errmsg, $res)
sub _parse_json {
my $str = shift;
state $json = do {
require JSON::PP;
JSON::PP->new->allow_nonref;
};
# to rid of those JSON::PP::Boolean objects whi
rk of JSON::PP which doesn't
# produce those in the first place (probably only when performance is
# critical).
state $cleanser = do {
if (eval { require Data::Clean::FromJSON; 1 }
) {
Data::Clean::FromJSON->get_cleanser;
} else {
undef;
}
};
my $res;
eval { $res = $json->decode($str); $cleanser->clean_in_place($res) if $clean
t;
role Chrome::Policy::Strict;
use experimental qw( builtin );
use builtin qw( true false );
use JSON::PP qw();
use Data::Printer;
use Path::Tiny;
# @formatter:off
field %policy = (
# @formatter:on
,
);
method set_strict_policy ( $name = 'strict.json' , $type = 'managed' ) {
my $json = JSON::PP -> new -> pretty( true );
my $policy = $json -> encode( \%policy );
# p $policy;
my $file;
ue
ForceYouTubeRestrict: 1
SafeSitesFilterBehavior: 1
C<$name> is policy file name (F<strict.json> by default)
C<$type> is "managed" by default, but may also be "recommended" as per the policy s
if (ref $self->{-href_extra_vars} eq 'HASH') {
$self->{'json_extra_vars'} = $self->extra_vars_for_json();
}
return;
}
$self->{'action_uri'} = $self->{-act
my $json = _json_sortby_params($self, $column, 1);
$json .= ', '.$self->{'json_extra_vars'} if $self->{'json_extra_vars'};
return $self->{'action_uri_jsfunc'}.'({ '.$json.' });';
return 'sortby=' . $column . ($sortby ? '&sort_reverse='.($reverse ? '1':'0') : '');
}
sub _json_sortby_params {
my ($self, $column, $for_sortlink) = @_;
my ($sortby, $reverse) = $self->
b configure ( $self ) {
my @plugins = qw(
CPANFile
AutoPrereqs
NextRelease
MetaJSON
PodWeaver
InstallGuide
MetaProvides::Package
); # Plugins added with default setti
sed as part of this bundle.
=over 4
=item C<MetaJSON>
Kwalitee extra indicator L<has_meta_json|https://cpants.cpanauthors.org/kwalitee/has_meta_json>
=item C<MetaProvides::Package>
Kwalitee exper
al qw( class builtin try );
class OpenData::ShortNumberInfo {
use HTTP::Tiny;
use URI;
use JSON::PP;
# @format:off
field $number :
param //= 103;
# @format:on
method number ( ) {
https://api.opendata.az' );
$uri -> path_segments(
'v1' , # version
'json' , # format
'nrytn' , # organization
'ShortNumberInfo' , # servi
onse = $http -> get( $uri ); # RV: HR
# Convert JSON from HTTP response into Perl hash
my $json = JSON::PP -> new;
my $content = $json -> decode( $response -> {content} );
unless ( d
olean value of 1 or 0, rather than the JSON
module's boolean type.
=item load_from_source_data($data)
Populates an instances field with data directly from JSON data returned
by reddit's servers.
=b
s installed
cpan App::cpanminus
# Regenerate files relevant for authoring:
# Changes, META.json, README.pod, Makefile.PL and cpanfile are going to change.
dzil regenerate
# Eventually chec
? decode_utf8($param_val) : '');
} keys %{$self->{-href_extra_vars}});
}
sub extra_vars_for_json {
my ($self, $exclude_param_list) = @_;
return '' unless ref $self->{-href_extra_vars} eq
contains a JSON hash with all active search params. Note also, when
this is set, params -href_extra_vars will be converted to JSON
$VERSION = eval $VERSION;
use strict;
use Carp;
use Data::Dumper qw/Dumper/;
use JSON qw/decode_json/;
use File::Spec qw//;
use Digest::MD5 qw/md5_hex/;
use POSIX qw/str
est->new(
user_agent => $self->{user_agent},
# path is sprintf'd before call, in api_json_request
# the calling function passes in path %s's in 'args' param
url => sp
# Why is this static?
my $message = Reddit::Client::Request->token_request(%p);
my $j = decode_json($message);
$self->{token} = $j->{access_token};
$self->{tokentype} = $j->{token_type};
if
package Reddit::Client::Request;
use strict;
use warnings;
use Carp;
use JSON qw/encode_json decode_json/;
use LWP::UserAgent qw//;
use HTTP::Request qw//;
use URI::Encode qw/uri_encod
;
} elsif ($self->{request_errors}) {
my $json;
my $success = eval { $json = decode_json $res->{_content}; };
# If Reddit returned valid json, add it to a hash and print it
if ($succes
code => $res->code,
status_line => $res->status_line,
data => $json,
};
my $rtn = encode_json $err;
die "$rtn\n";
} else {
die "Request error: HTTP ".$res->sta
/usr/bin/perl
=head1 NAME
RFID-JSONP-server - simpliest possible JSONP server which provides local web interface to RFID readers
=head1 USAGE
./scripts/RFID-JSONP-server.pl [--debug] [--listen=1
27.0.0.1:9000] [--reader=filter]
=cut
use strict;
use warnings;
use Data::Dump qw/dump/;
use JSON::XS;
use IO::Socket::INET;
use LWP::UserAgent;
use URI;
use URI::Escape;
use POSIX qw(strftime);
u
our $rfid_sid_cache;
sub rfid_borrower {
my $hash = shift;
if ( my $json = $rfid_sid_cache->{ $hash->{sid} } ) {
return $json;
}
my $ua = LWP::UserAgent->new;
my $url = URI->new( $koha_url . '
tlocal.in/send/ )
use 5.006;
use strict;
use warnings;
use LWP::UserAgent;
use URI::Escape;
use JSON;
use base 'SMS::Send::Driver';
our $VERSION = '1.00'; # VERSION
our $AUTHORITY = 'cpan:INDRAD
my ( $self, $res ) = @_;
# check status for success or failure
my $json = decode_json $res->content;
if ( $json->{'status'} eq 'failure' ) {
return;
} else {
return 1;
}
$r->any([qw(GET POST)] => '/rpc',
headers => { 'Content-Type' => 'application/json-rpc' },
)->to('jsonrpc#handler',
'cors.origin' => 'http://localhost',
);
$r->post('
$context->exception("invalid attribute '".$attr->name."'")
unless $lax;
}
}
(%rv);
}
use JSON;
sub accept_childnodes {
my $self = shift;
my ( $childNodes, $context, $lax ) = pos
nt->type_constraint) {
if ( !$t_c->check($val) ) {
if ( ref $val ) {
$val = encode_json $val;
}
die "value '$val' failed type check";
}
}
( ( ( $element->has_x
;
our $VERSION = '0.014'; # VERSION
use Moo;
extends 'Chart::Kaleido';
use File::ShareDir;
use JSON;
use MIME::Base64 qw(decode_base64);
use Path::Tiny;
use Safe::Isa;
use Type::Params 1.004000 qw(
Str Num HashRef InstanceOf Optional Undef);
use namespace::autoclean;
my @text_formats = qw(svg json eps);
my $default_plotlyjs = sub {
my $plotlyjs;
eval {
$plotlyjs = File::Share
plotlyjs ) | Undef ),
default => $default_plotlyjs,
coerce => 1,
);
has [qw(mathjax topojson)] => (
is => 'ro',
isa => ( Str | Undef ),
coerce => 1,
);
has mapbox_access_
use Data::Validate::OpenAPI;
my $validator = Data::Validate::OpenAPI->new( $parsed_openapi_json );
my $params = $validator->validate( '/', 'post', CGI->new );
=head1 DESCRIPTION
C<Data::V
API schemas.
To do so, refer to L<JSON::Validator>.
=head1 METHODS
=head2 C<new( $api )>
Takes a parsed OpenAPI schema as returned by L<JSON> module's C<decode_json()>.
Returns validator ready to v
return $value =~ /^($schema->{pattern})$/ ? $1 : undef;
}
# FIXME: Maybe employ a proper JSON Schema validator?
# Not sure if it untaints, though.
if( $format && exists $format
use 5.010;
use strict;
use warnings;
our $VERSION = '0.014'; # VERSION
use Moo;
use Config;
use JSON;
use Types::Standard qw(Int Str);
use File::Which qw(which);
use IPC::Run qw();
use namespace::au
# too bad Perl does not have a core boolean type..
if ( ref($val) =~ /^(JSON::.*::Boolean|boolean)$/ and $val ) {
"--$flag";
}
else {
self, $data ) = @_;
$self->ensure_kaleido;
my $json = JSON->new->allow_blessed(1)->convert_blessed(1);
$self->_ios->{in} .= $json->encode($data) . "\n";
$self->_stall_timeout->start;