t, list, and delete passwords from the
CLI. Passwords are stored in `~/.password_manager.json` in a simple JSON object
(hash) structure. Currently a very early release that still needs to be updated.
, list, and delete passwords from the
CLI. Passwords are stored in C<~/.password_manager.json> in a simple JSON object
(hash) structure. Currently a very early release that still needs to be updated.
LWP::UserAgent->new(
default_headers => HTTP::Headers->new(
Accept => 'application/json; charset=utf-8',
),
env_proxy => 1,
);
$http_client->agent($agent) if $agent;
l websocket client for Mattermost.
use Encode 'encode';
use Mojo::IOLoop;
use Mojo::JSON qw(decode_json encode_json);
use Moo;
use MooX::HandlesVia;
use Types::Standard qw(ArrayRef Bool InstanceOf In
lf->logger->debugf('[Seq: %d] Sending ping', $self->last_seq);
}
return $tx->send(encode_json({
seq => $self->last_seq,
action => 'ping',
}));
}
sub _on_start {
my
y $tx = shift;
my $input = shift;
return unless $input;
my $message = decode_json(encode('utf8', $input));
if ($message->{seq}) {
$self->logger->debugf('[Seq: %d]', $
Spec::Functions qw[catfile catdir rel2abs abs2rel splitdir curdir];
use JSON::PP 2 qw[encode_json decode_json];
# Not in CORE
use Path::Tiny qw[path];
use ExtUtils::Helpers
#
field $action : param //= 'build';
field $meta : reader = CPAN::Meta->load_file('META.json');
# Params to Build script
field $install_base : param //= '';
field $installdirs
param //= '';
field $prefix : param //= '';
#
ADJUST {
-e 'META.json' or die "No META information provided\n";
}
method write_file( $filename, $content ) { pa
f.registration.showNotification('Push Notification', options)
);
});
=head2 STEP 4 - manifest.json
Required for Chrome; Firefox works even without this file:
{
"short_name" : "Push",
"name"
Encode ();
use DirHandle;
use Mojo::Base qw( Mojolicious::Plugin -signatures );
use Mojo::JSON qw(encode_json);
use Mojolicious::Types;
# Stolen from Plack::App::Direcotry
my $dir_page = <<'PAGE';
<
index = $args->{dir_index};
my $auto_index = $args->{auto_index} // 1;
my $json = $args->{json};
$dir_page = $args->{dir_page} if ( $args->{dir_page} );
$app->hook(
}
if( $auto_index ) {
render_indexes( $c, $path, $json );
} else {
$c->reply->not_found;
}
pter to Node-RED JSON HTTP request PSGI Script
=head1 DESCRIPTION
A PSGI application to control SMS::Send with a web service.
=head1 API
The script is called over HTTP with a JSON Object payload.
nnel::SMSbox|SMS::Send::Kannel::SMSbox> and L<NANP::Twilio|SMS::Send::NANP::Twilio>.
Return is a JSON Object.
200 OK
{
"sent" : true,
"input" : {...},
}
Return on error.
400|500|50
p request, and debug.
=over
=item * In the function node
=over
=item * Set the "payload" to a JSON Object with the keys "driver", "to" and "text" and any extra "options" needed for SMS::Send objec
apter to Node-RED JSON HTTP request CGI Script
=head1 DESCRIPTION
A CGI application to control SMS::Send with a web service.
=head1 API
The script is called over HTTP with a JSON Object payload.
nnel::SMSbox|SMS::Send::Kannel::SMSbox> and L<NANP::Twilio|SMS::Send::NANP::Twilio>.
Return is a JSON Object.
200 OK
{
"sent" : true,
"input" : {...},
}
Return on error.
400|500|50
p request, and debug.
=over
=item * In the function node
=over
=item * Set the "payload" to a JSON Object with the keys "driver", "to" and "text" and any extra "options" needed for SMS::Send objec
package WWW::Kickstarter::JsonParser;
die "Place holder for documentation. Not an actual module";
__END__
=head1 NAME
WWW::Kickstarter::JsonParser - JSON parser connector for WWW::Kickstarter
=
>new(
json_parser_class => 'WWW::Kickstarter::JsonParser::JsonXs', # default
...
);
=head1 DESCRIPTION
This module documents the interface that must be provided by JSON parsers to
my $parser = $json_parser_class->new();
The constructor. An L<WWW::Kickstarter::Error> object is thrown on error.
=head1 METHODS
=head2 decode
my $data = $parser->decode($json);
Returns a d
will attempt
# to turn it into a Perl data structure usin JSON::XS::Maybe::decode_json; it
# them applies "d2o -autoundef" to it; if the JSON decode fails, the error will
# be hidden silently and the
# To force the JSON decode error to propagate up so that it may be caught, use
# the "-autothrow" option, e.g.;
# HTTPTiny2h2o -autothrow, $ref_with_bad_JSON; # propagates decode_json exception from
SON
# HTTPTiny2h2o $ref_with_bad_JSON; # hides bad decode, "->content" accessor created to return original content
# HTTPTiny2h2o $ref_with_good_JSON; # h2o applied to $ref,
se JSON::XS qw{decode_json encode_json};
use SMS::Send;
use CGI;
our $VERSION = '0.10';
our $PACKAGE = __PACKAGE__;
=head1 NAME
SMS::Send::Adapter::Node::Red - SMS::Send Adapter to Node-RED JSON HT
head1 DESCRIPTION
This Perl package provides an adapter from Node-RED HTTP request object with a JSON payload to the SMS::Send infrastructure using either a PSGI or a CGI script. The architecture wo
w
my $object = SMS::Send::Adapter::Node::Red->new(content=>$string_of_json_object);
=head1 PROPERTIES
=head2 content
JSON string payload of the HTTP post request.
Example Payload:
{
"to"
#call web service die on critical error
#parse return with a package like XML::Simple or JSON::XS
#return 1 for successful or 0 for unsuccessful
}
=head1 DESCRIPTION
The SMS::Send::Dr
package SMS::Send::VoIP::MS;
use strict;
use warnings;
use URI;
use JSON::XS qw{decode_json};
use base qw{SMS::Send::Driver::WebService};
our $VERSION = '0.04';
=head1 NAME
SMS::Send::VoIP::MS - SM
:VoIP::MS->new;
my $success = $sms->send_sms(text=> 'Hello World!', to =>'+17035550123');
my $json = $sms->{__content};
my $href = $sms->{__data};
=head1 DESCRIPTION
SMS::Send driver for
= $response->{'content'};
#{"status":"success","sms":40702183}
my $data = decode_json($response->{'content'});
$self->{'__data'} = $data;
return $data->{'status'} eq 'success'
Node-RED JSON HTTP request Plack Builder PSGI Script
=head1 DESCRIPTION
A PSGI application to control SMS::Send with a web service.
=head1 API
The script is called over HTTP with a JSON Object pa
nnel::SMSbox|SMS::Send::Kannel::SMSbox> and L<NANP::Twilio|SMS::Send::NANP::Twilio>.
Return is a JSON Object.
200 OK
{
"sent" : true,
"input" : {...},
}
Return on error.
400|500|50
p request, and debug.
=over
=item * In the function node
=over
=item * Set the "payload" to a JSON Object with the keys "driver", "to" and "text" and any extra "options" needed for SMS::Send objec
ILDARGS => sub {
my $orig = shift;
my $self = shift;
my $args = shift;
# Convert JSON::PP::Boolean into regular boolean
$args->{prepackaged} = $args->{prepackaged} ? 1 : 0;
r
ervice::Mattermost::V4::API::Response;
# ABSTRACT: Container for API responses.
use Mojo::JSON 'decode_json';
use Moo;
use Types::Standard qw(Any ArrayRef Bool InstanceOf Int Maybe Object Str);
use
#####
sub BUILD {
my $self = shift;
if ($self->_looks_like_json($self->raw_content)) {
$self->content(decode_json($self->raw_content));
}
return 1;
}
######################
##########################################
sub _looks_like_json {
my $self = shift;
my $inp = shift;
# Rudimentary "is it JSON?" hack
return $inp && $inp =~ /^[\{\[]/ ? 1 : 0;
}
##
ft;
my $ret = $cl->do_task( "insert_job", json($req) );
return undef unless $ret;
return $$ret unless $$ret =~ /^\s*[\[\{]/;
return unjson($$ret);
}
$ret = do_req(
{ funcname =>
7 00:39:55Z bradfitz $
use strict;
use File::Spec;
use Carp qw(croak);
use DBI;
use FindBin;
use JSON::Any;
use lib "$ENV{HOME}/hack/Data-ObjectDriver/lib";
use lib "$ENV{HOME}/hack/TheSchwartz/lib"
lib "$ENV{HOME}/cvs/gearman/api/perl/Gearman/lib";
sub json {
return JSON::Any->objToJson(shift);
}
sub unjson {
return JSON::Any->json_to_obj(shift);
}
sub test_client {
my %opts = @_;
type;
if (grep { $_ eq $request->method } ($self->PUT, $self->POST)) {
$form_type = 'json';
} else {
$form_type = 'form';
}
$form_type = $args->{override_data_type} i
goal of the Platypus Project is to reduce
common interface specifications to a common format like JSON that could
be shared between different languages.
=item FFI / Platypus could be a bridge to Raku
ile.PL
Generating a Unix-style Makefile
Writing Makefile for Foo
Writing MYMETA.yml and MYMETA.json
$ make
cp lib/Foo.pm blib/lib/Foo.pm
"/home/ollisg/opt/perl/5.37.5/bin/perl5.37.5" -MFFI::Buil
nerating a Unix-style Makefile
Writing Makefile for FFI::Platypus
Writing MYMETA.yml and MYMETA.json
%
=item FFI_PLATYPUS_NO_ALLOCA
Platypus uses the non-standard and somewhat controversial C fun