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
YNOPSIS
use API::Google::GCal;
my $gapi = API::Google::GCal->new({ tokensfile => 'config.json' });
my $user = 'someuser@gmail.com';
my $calendar_id = 'ooqfhagr1a91u1510ffdf7vfp
eded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('PUT', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
);
unless ($client->validate_agent($client->get_json_schema, $main_site_definition)) {
die("agent defition is not valid for agent json schema");
}
if ($client->create_agent('mai
ypes::Moose qw( Str );
use MooseX::Types::URI qw(Uri);
use URI;
use URI::QueryParam;
use JSON::MaybeXS;
use JSON::Schema;
use Time::HiRes;
use LWP::UserAgent;
use HTTP::Request;
our $VERSION = '0.003
->env_proxy;
my $json = JSON::MaybeXS->new;
=head2 create_agent( $agent_name, $content)
=head2 create_agent($agent_name, $hashref_definition)
=head2 create_agent($agent_name, $json_definition)
::Minecraft::UUIDLookup;
use 5.006;
use strict;
use Data::UUID;
use Moo;
use LWP::UserAgent;
use JSON;
our $VERSION = '0.05';
=head1 NAME
WebService::Mojang::Minecraft::UUIDLookup - look up Minecr
with an empty body
if ($response->code == 204) {
return;
}
my $result = JSON::from_json($response->decoded_content)
or die "Failed to parse Mojang API response";
die "Failed to query Mojang API: " . $response->status_line;
}
my $result = JSON::from_json($response->decoded_content)
or die "Failed to parse Mojang API response";
{
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
ssing ) \
&& cpanm $( dzil listdeps_darkpan --missing )
and have it work.
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Dist::Zilla::Plugin::Prereqs::DarkPAN",
"interface":"class",
"
herits":"Moose::Object",
"does":"Dist::Zilla::Role::PrereqSource::External"
}
=end MetaPOD::JSON
=for Pod::Coverage register_external_prereqs
=head1 DarkPAN Configurations.
=head2 A Simple HT
.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
PUT
json
plain
headers
response
http_get
http_post
http_put
http_delete
http_head
http_upload
json_get
json_post
json_put
json_head
/;
use
LWP::UserAgent;
use HTTP::Request;
use Try::Tiny;
use JSON;
our $VERSION = '0.20';
my $user_agent = "LWP::Simple::REST";
my $lwp = LWP::UserAgent->new;
my $response;
sub user_agent { $lwp->agent(
$_[0] ) }
sub response { $response }
sub plain { return ($_[0]->content ) }
sub json { return decode_json($_[0]->content ) }
sub headers { return $_[0] ? $_[0]->headers : $response->headers };
s
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';
}
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
}
)->recv;
# Send job, data created by encoding @args with JSON
use JSON::XS;
$client->encoder(\&JSON::XS::encode_json);
my $job2 = $client->put(
{ priority => 100,
ttr
ld_dist_dir> also apply to this method.
=begin MetaPOD::JSON v1.0.0
{
"namespace":"File::ShareDir::ProjectDistDir"
}
=end MetaPOD::JSON
=head1 SIGNIFICANT CHANGES
=head2 1.000000
=head3 Str
ance = rule_NumericsToCode( @args );
=head1 METHODS
=head2 C<filter_plaintext>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"CPAN::Changes::Markdown::Filter::Rule::NumericsToCode",
"interface
o::Object",
"does":"CPAN::Changes::Markdown::Role::Filter::Rule::PlainText"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentnl@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is co
ance = rule_VersionsToCode( @args );
=head1 METHODS
=head2 C<filter_plaintext>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"CPAN::Changes::Markdown::Filter::Rule::VersionsToCode",
"interface
o::Object",
"does":"CPAN::Changes::Markdown::Role::Filter::Rule::PlainText"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentnl@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is co
de )],
handles => { _decode => 'execute', },
);
sub _build__decoder {
require JSON::MaybeXS;
my $decoder = JSON::MaybeXS->new()->utf8(1)->relaxed(1);
return sub {
$decoder->decode(shift);
> sub { q{0.1.0} },
);
class_has '_extension' => (
isa => Str,
ro, lazy, default => sub { q{.json} },
);
class_has '_schema_creator' => (
isa => CodeRef,
ro, lazy_build,
traits => [qw( Co
pts) );
}
sub check {
my ( $self, $json_data, $opts ) = @_;
$opts = $self->_opt_check($opts);
return $self->_schema($opts)->check($json_data);
}
1;
__END__
=pod
=encoding UTF-8
=
te_bundle('Example::Author::KENTNL');
$bundle->configure;
my @stopwords = (
qw(
MetaEbuild json ShareDir
)
);
for my $wordlist (@stopwords) {
$bundle->add_or_append_policy_field( 'Documen
=head2 C<support>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Git::Wrapper::Plus",
"interface":"class",
"inherits":"Moo::Object"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kent
s.
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Dist::Zilla::Util::EmulatePhase::PrereqCollector",
"interface":"class",
"inherits":"Moose::Object"
}
=end MetaPOD::JSON
=head1 AUTHOR
Ke
WW::XKCD::AsText::VERSION = '0.006';
use namespace::autoclean;
use Moose;
use Carp;
use URI;
use JSON;
use LWP::UserAgent;
has 'timeout' => (
is => 'ro',
isa => 'Maybe[Int]',
required => 1,
.com/$id/"));
my $json_uri = URI->new("https://xkcd.com/$id/info.0.json");
my $response = $self->ua->get($json_uri);
if ($response->is_success){
my $decoded = decode_json($response->content