4';
use v5.20;
use namespace::autoclean;
use Moose;
use MooseX::SetOnce;
use Data::Dumper;
use JSON;
use LWP::UserAgent;
use URI;
use XML::LibXML;
extends 'App::RoboBot::Plugin';
=head1 api.trans
my $json;
eval {
$json = decode_json($response->decoded_content);
};
return 0 if $@;
return 0 unless ref($json) eq 'HASH' && exists $json->{'access_token'} && $json->{'acce
ss_token'} =~ m{HMACSHA256};
$self->token($json->{'access_token'});
$self->last_authed(time() +0);
return 1;
}
sub translate_text {
my ($self, $message, $command, $rpl, $from, $to,
ded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('POST', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
ded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('POST', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
ot::Parser;
use Clone qw( clone );
use Data::Dumper;
use DateTime;
use DateTime::Format::Pg;
use JSON;
use Scalar::Util qw( blessed );
has 'bot' => (
is => 'ro',
isa => 'App::Robo
etwork => $network,
name => $res->{'name'},
arguments => decode_json($res->{'arguments'}),
definition => $res->{'definition'},
definer => A
macro_id = ?
}, {
name => $self->name,
arguments => encode_json($self->arguments),
definition => $self->definition,
is_locked => $self->
Getopt-Long
HTTP-Tiny
I18N-LangTags
IPC-Cmd
IO
IO-Compress
IO-Zlib
IO-Socket-IP
JSON-PP
Locale-Maketext
Locale-Maketext-Simple
MIME-Base64
Math-BigInt
Math-BigInt-FastCalc
.20;
use namespace::autoclean;
use Moose;
use MooseX::ClassAttribute;
use MooseX::SetOnce;
use JSON;
has 'id' => (
is => 'rw',
isa => 'Int',
traits => [qw( SetOnce )],
id => $res->{'id'},
name => $res->{'name'},
extradata => decode_json($res->{'extradata'}),
log_enabled => $res->{'log_enabled'},
network => (grep
lf.
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Dist::Zilla::Plugin::Bootstrap::lib",
"interface":"class",
"does":"Dist::Zilla::Role::Bootstrap"
}
=end MetaPOD::JSON
=head1 USE CASES
use Moose;
use MooseX::SetOnce;
use AnyEvent;
use AnyEvent::Mattermost;
use Data::Dumper;
use JSON;
use LWP::Simple;
use Try::Tiny;
use App::RoboBot::Channel;
use App::RoboBot::Nick;
extends 'Ap
msg->{'data'}{'post'} && length($msg->{'data'}{'post'}) > 0;
my $post = try {
decode_json($msg->{'data'}{'post'});
} catch {
return;
};
my $nick = App::RoboBot::Ni
{
my ($self) = @_;
my $home = File::HomeDir->my_home();
my @exts = qw( conf yml yaml json xml ini );
my @bases = ("$home/.lispy/lispy.", "$home/.lispy.", "/etc/lispy.");
my @conf
ded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('POST', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
s';
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('POST', 'application/json', $creds, $main->baseUrl . $uri, $vars);
return $response;
}
1;
ckage Document::eSign::Docusign::buildCredentials;
use strict;
use warnings;
use XML::LibXML;
use JSON;
# Builds the auth credentials.
=head1 NAME
Document::eSign::Docusign::buildCredentials - Buil
Version 0.02
=head1 functions
=head2 new($parent)
Builds an XML or JSON login string for the Docusign header. Setting "usejsononly" to a non-undef (null) in the constructor determines this behavio
return $main->authxml;
}
if ( $main->usejsononly ) {
my $json = JSON->new();
$main->authxml($json->encode(
{
Username => $main->
rogress :)
=head1 VERSION
version 0.03
=head1 KEY FEATURES
=over 6
=item 1. State machine in JSON file
Allows to create a simple bots for house even for housewife
=item 2. Support of dymanic sc
em 3. Independent and prev msg dependent screens
Screens can be shown just according sequence in JSON or can depends on previous user reply (callback_msg property)
=item 4. Data validation
Bot can
package Document::eSign::Docusign::sendRequest;
use strict;
use warnings;
use JSON;
use LWP::UserAgent;
use HTTP::Headers;
use URI;
use Carp;
use Data::Dumper;
=head1 NAME
Document::eSign::Docusign:
DocuSign-Authentication' => $credentials,
Accept => 'application/json',
),
);
$ua->add_handler( "request_send", sub { shift->dump; return } )
if
e, $jsonparams, $multipart );
my $json = JSON->new->allow_nonref;
if ( defined $params
&& defined $contenttype
&& $contenttype =~ /json|multipart/i )
{
$jsonpara
ded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('POST', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
YNOPSIS
use API::Google::GCal;
my $gapi = API::Google::GCal->new({ tokensfile => 'config.json' });
my $user = 'someuser@gmail.com';
my $calendar_id = 'ooqfhagr1a91u1510ffdf7vfp
een for this callback
$msg = { chat_id => $chat_id, text => 'No screen found! Check your config.json'};
return $msg;
}
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Telegram::BotKit::Wizar
JSON;
use Data::Dumper;
sub new {
my ($class, $params) = @_;
my $h = {};
if ($params->{tokensfile}) {
$h->{tokensfile} = Config::JSON->new($params->{tokensfile});
} else {
die 'no json
oken';
$self->{ua}->post('https://www.googleapis.com/oauth2/v4/token' => form => $params)->res->json; # tokens
};
sub client_id {
shift->{tokensfile}->get('gapi/client_id');
}
sub ua {
shift->
->{payload}) {
$tx = $self->{ua}->build_tx(uc $http_method => $params->{route} => $headers => json => $params->{payload})
} else {
die 'wrong http_method on no payload if using POST';
}
mper;
use Config::JSON;
use Tie::File;
use Crypt::JWT qw(decode_jwt);
use feature 'say';
use Mojo::Util 'getopt';
use Mojolicious::Plugin::OAuth2;
# use Mojo::JWT;
# sub return_json_filename {
# u
les = readdir $dir;
# my @j = grep { $_ =~ /\w+.json/ } @files;
# return $j[0];
# }
# my $f = return_json_filename();
my $config = Config::JSON->new($ENV{'GOAUTH_TOKENSFILE'});
delete $ENV{'GOA
com/oauth2/v4/token' => form => $hash)->res->json;
return $tokens;
};
# =method get_all_google_jwk_keys
# Get all Google JWK keys for validation of JSON Web Token
# Check https://jwt.io/ and http
reens;
$Telegram::BotKit::Screens::VERSION = '0.03';
# ABSTRACT: Implements navigation by screens JSON file. Used by Telegram::BotKit::Wizard
use common::sense;
use Data::Dumper;
sub new {
my $
# two or more child screens with same parent and without callback_msg specific
die "wrong json file";
}
}
} else {
return undef;
}
}
sub get_prev_screen_by_name {
my ($self, $scree
=pod
=encoding UTF-8
=head1 NAME
Telegram::BotKit::Screens - Implements navigation by screens JSON file. Used by Telegram::BotKit::Wizard
=head1 VERSION
version 0.03
=head1 SYNOPSIS
# $screen