oogle::Cloud::Speech::Auth;
use Mojo::Base '-base';
use Mojo::Collection;
use Mojo::JSON qw(encode_json decode_json);
use Mojo::JWT::Google;
use Mojo::UserAgent;
has scopes => sub { ['https://www.go
as from_json => sub { };
has jwt_token_enc => undef;
has jwt_token => undef;
sub jwt {
my $self = shift;
return Mojo::JWT::Google->new(
from_json => $self->from_json,
,
);
my $res = $tx->res;
if ( $res->is_success and $res->json('/access_token') ) {
my $token_obj = $res->json;
my $token = $token_obj->{'token_type'} . ' ' . $token_obj->{
aliases => {l=>{}},
},
);
sub __json_encode {
state $json = do {
require JSON::MaybeXS;
JSON::MaybeXS->new->canonical(1);
};
$json->encode(shift);
}
sub _connect {
$row = $sth->fetchrow_arrayref;
return undef unless $row;
}
__json_encode($row);
};
[200, "OK", $code_get_row, {stream=>1}];
}
$SPEC{dump_sqlite_table} =
rue : $False;
}
fun IsTrue($arg) {
return Type($arg) eq $TrueType ? $True : $False;
}
fun TO_JSON($arg) {
no strict 'refs';
return ${$arg} ? $TrueRef : $FalseRef;
}
fun True() {
return $
d2 to_json
TO_JSON(Any $arg) : Ref['SCALAR']
The TO_JSON method returns a scalar ref representing truthiness or falsiness
based on the arguments passed, this function is commonly used by JSON enco
=over 4
=item TO_JSON example #1
my $bool = Data::Object::Boolean->new(1);
$bool->TO_JSON; # \1
=back
=over 4
=item TO_JSON example #2
Data::Object::Boolean::TO_JSON(
Data::Object::
ed automatically. It is possible to save the cookie jar
to persistent storage with something like JSON or Storable - see the
C<AnyEvent::HTTP::cookie_jar_expire> function if you wish to remove
expired
interactive protocol is used (typical example would be the
push-style twitter API which starts a JSON/XML stream).
If you think you need this, first have a look at C<on_body>, to see if
that doesn't
;
use Module::CoreList;
use OrePAN2::Injector;
use OrePAN2::Indexer;
use Cpanel::JSON::XS qw/ encode_json decode_json /;
our $VERSION = '0.03_01';
my $ua = LWP::UserAgent->new( keep_alive => 2, age
pe" => "text/json",
"Accept" => "text/json"
], encode_json($q) );
my $res = $ua->request($req);
die $res->status_line if !$res->is_success;
my $data = decode_json($res->decode
pe" => "text/json",
"Accept" => "text/json"
], encode_json($q) );
my $res = $ua->request($req);
die $res->status_line if !$res->is_success;
my $data = decode_json($res->decode
method($method);
my $response = $self->user_agent->request( $request );
use JSON::MaybeXS qw( decode_json );
use Encode qw( encode );
# We want to be able to set it, but do not want
response;
die $response->status_line unless $response->is_success;
my $payload = decode_json encode('utf8', $response->decoded_content);
# Some API calls return empty objects, which can
ew(
x=>1,
file_name => \"/tmp/file.txt",
y=>[
"Content-Type" => "text/json",
name => 'my-name',
filename => 'my-filename',
_ => '{"count": 666
idity checks and does not create nice objects for each item. You
get the raw data as decoded from JSON.
=head1 AUTHOR
Robert Wohlfarth <rbwohlfarth@gmail.com>
=head1 REPOSITORY
L<https://github.co
::Zilla::Plugin::MetaConfig;
use Dist::Zilla::Plugin::MetaResources;
use Dist::Zilla::Plugin::MetaJSON;
use Dist::Zilla::Plugin::InstallGuide;
use Dist::Zilla::Plugin::CopyFilesFromBuild;
use Dist::Zi
support for setting repo metadata
'MetaResources',
# include a META.json file in addition to META.yml
'MetaJSON' ,
);
$self->add_plugins(
# auto-make INSTALL
'InstallGuide' ,
s set
[PodWeaver] ; if is_task is NOT set
[MetaConfig]
[MetaResources]
[MetaJSON]
[InstallGuide]
[CopyFilesFromBuild]
copy=INSTALL
[NextRelease]
[ExtraTes
# Id generator's for titles and subjects
my @json; # Json holding titles and subjects
for my $t(sort keys %$classif
ification->{$t}{$s}->%*) # Load topics for title and subject
{push @json, qq(topicDetails.push([$iTitle, $iSubject, "$f"]););
}
push @h, <<END;
ed topics
<td valign="top">
<div id="div"></div>
END
my $json = join "\n", @json; # Json containing title and subjects to topics
push @h, <<END;
atus to_Notification );
use IO::Async::Loop;
use Net::Async::HTTP;
use Try::Tiny;
use JSON::MaybeXS qw( decode_json );
use Log::Any;
my $log = Log::Any->get_logger(category => 'Mastodon');
has insta
ecode_json $chunk;
$self->emit( $current_event => $payload );
}
catch {
$self->emit( error => 0,
"Error decoding JSON payl
item B<api_version>
The API version to use. Defaults to C<1>.
=item B<coerce_entities>
Whether JSON responses should be coerced into Mastodon::Entity objects.
Currently defaults to false (but this
x=>1,
file_name => \"/tmp/file.txt",
y=>[
"Content-Type" => "text/json",
name => 'my-name',
filename => 'my-filename',
_ => '{"co
App::Tailor;
use JSON::XS qw(decode_json);
# ignore lines containing /ping
ignore qr/\/ping/;
# parse JSON-encoded lines
modify qr/^{/ => sub{
my $data = decode_json $_;
my $msg =
0.9.8';
use strict;
use Qgoda;
use base 'Qgoda::Command';
sub _getDefaults { output_format => 'JSON' }
sub _getOptionSpecs {
output_format => 'output-format=s'
}
sub _run {
my ($self, $ar
he default output format JSON with one of:
=over 8
=item YAML
See L<http://yaml.oprg/>
=item PERL
Serialized into Perl code.
=item STORABLE
See L<Storable>.
=item JSON
The default output form
(uniq);
use YAML::XS 0.67;
use AnyEvent::Filesys::Notify 1.23;
use boolean;
$YAML::XS::Boolean = 'JSON::PP';
use Qgoda::Logger;
use Qgoda::Config;
use Qgoda::Site;
use Qgoda::Asset;
use Qgoda::Analyz
at = $options{output_format};
$format = 'JSON' if empty $format;
if ('JSON' eq uc $format) {
require JSON;
print JSON::encode_json($data);
} elsif ('YAML' eq uc $format) {
namespace {
my ($self, $plugin_data) = @_;
die __x("Field '{field}' missing in 'package.json'.\n",
field => 'qgoda.module')
if !exists $plugin_data->{module};
die __x
lf->{__modules}->{$module_name} = $plugin_data;
die __x("Field '{field}' missing in 'package.json'.\n",
field => 'qgoda.entry')
if !exists $plugin_data->{entry};
my $entr
u:%02u%s',
$time[5] + 1900, $time[4] + 1, $time[3], $time[2], $time[1],
$time[0], $tz);
}
sub TO_JSON {
my ($self) = @_;
return $self->ISOString;
}
1;
ABSTRACT: interact with Etherpad API
use Mojo::Base -base;
use Mojo::UserAgent;
use Mojo::JSON qw(decode_json);
use Mojo::IOLoop;
use Data::Dumper;
use Carp qw(carp);
has 'url';
has 'apikey';
has 'u
if ($res->is_success) {
# Can’t use $res->json when json is too large
my $json = decode_json($res->body);
if ($json->{code} == 0) {
return 1 if $args->{boolea
key}) {
$data = (ref($json->{data}) eq 'HASH') ? $json->{data}->{$args->{key}} : $json->{data};
} else {
$data = $json->{data};
}
r
e '_config.yml') {
$filename = '_config.yml';
} elsif (-e '_config.json') {
$filename = '_config.json';
} elsif (!$q->getOption('no-config')) {
$logger->warning(__"conf
$local_filename = '_localconfig.yml';
} elsif (-e '_localconfig.json') {
$local_filename = '_localconfig.json';
}
my $local_yaml = '';
if (!empty $local_filename) {
->{paths}->{views}]
if 0 == @{$config->{po}->{tt2}};
# This outsmarts the default options for JSON schema.
my $processor_options = $schema->{properties}
->{processors}->{
'Regexp' || $ref eq 'REGEXP') {
die "Cannot dump regexp objects";
}
if ($ref eq 'JSON::PP::Boolean') {
return $val ? 't' : 0; # XXX should we dump false as nil or 0?
}