return '';
};
get '/map' => sub {
return to_json( $webio->pin_desc( $default_name ) );
};
get qr{\A / \* }x => sub {
return to_json( $webio->all_desc( $default_name ) );
};
get '/' =>
s point, you should be able to startup Apache. Calling
C<http://example.com/*> should get you a JSON dump of the pins. Calling
C<http://example.com/app/app/gpio-header/index.html> should get you a
generation --- generate files
#pod #
#pod [ModuleBuild]
#pod [MetaYAML]
#pod [MetaJSON]
#pod [Manifest]
#pod [License]
#pod [ReadmeAnyFromPod]
#pod [CPANFile]
#pod
#pod
# add META.yml (supports CPAN::Meta::Spec v1.4)
'MetaJSON', # add META.json (supports CPAN::Meta::Spec v2.0 upwards)
'CPANFile',
};
if ($dzil_meta->install_json) {
$self->log("Excluding packages of Dist::Zilla distribution");
$dzil_pkg = $dzil_meta->install_json_hash->{provides};
}
e warnings;
use 5.010;
our $VERSION = '0.06'; # VERSION
use Moo;
use CGI;
use Data::Dumper;
use JSON;
use Try::Tiny;
use Digest::SHA qw(hmac_sha1_hex);
use File::ShareDir qw(module_dir);
use File::C
>param('POSTDATA');
} else {
return;
}
}
has payload_json => (
is => 'lazy',
);
sub _build_payload_json {
my $self = shift;
my $q = $self->cgi;
my $payload =
});
if ($self->payload) {
$payload = $self->payload;
try {
decode_json($payload);
} catch {
s/\"/\'/g; s/\n/ /gs;
$payload = qq({"error"
s::Validate;
use MooseX::WithCache;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
use JSON;
use Class::Date qw/gmdate/;
use POSIX; #strftime
use YAML qw/Dump LoadFile DumpFile/;
use Encode
h = HTTP::Headers->new();
$h->header( 'Content-Type' => "application/json" );
$h->header( 'Accept' => "application/json" );
my $data;
#Only password flow allows refresh tokens
if(
TP::Headers->new();
$h->header( 'Content-Type' => "application/json" );
$h->header( 'Accept' => "application/json" );
$h->header( 'Authorization' => "Bearer " . $self->valid_ac
package Test::HTTP::MockServer::REST;
use strict;
use warnings;
use JSON::XS;
sub new {
my ($class) = shift;
$class = ref $class || $class;
my %dispatch = @_;
return bless { d => \%di
if ($input_content && $input_ct && $input_ct eq 'application/json') {
eval {
$input_data = decode_json $req->content;
};
if ($@) {
&& $a eq 'application/json') {
eval {
my $out = encode_json $return_data;
$res->header('Content-type', 'application/json');
::Number;
use Test2::Bundle::Extended;
use JSON::Typist;
our $is_number = validator(sub {
my (%params) = @_;
return (ref($params{got}) || '') eq 'JSON::Typist::Number';
});
our $is_number_or_n
XML::LibXML;
use HTML::Selector::XPath qw/selector_to_xpath/;
use Carp qw/ confess /;
use JSON qw/ decode_json /;
our $VERSION = "0.08";
our @EXPORT_OK = qw/ j fn /;
our @EXPORT = qw/ j /;
use cons
] =~ /^\d+$/;
# json array or object
return decode_json($_[0])
if $_[0] =~ /^(?:\{|\[)/;
# boolean
return JSON::true if $_[0] eq 'true';
return JSON::false if $_[0] eq
package JMAP::Validation::Checks::Boolean;
use Test2::Bundle::Extended;
our $is_boolean = validator(sub {
my (%params) = @_;
return (ref($params{got}) || '') eq 'JSON::PP::Boolean';
});
1;
::Generators::SetError;
use strict;
use warnings;
use JMAP::Validation::Generators::String;
use JSON::Typist;
my %types = (
invalidArguments => {
description => JMAP::Validation::Generators::
ors;
foreach my $type (@types ? @types : (keys %types)) {
push @SetErrors, {
type => JSON::Typist::String->new($type),
($types{$type} ? (%{$types{$type}}) : ()),
};
}
retur
:Array;
# data types {{{
sub is_string {
my ($value) = @_;
return (ref($value) || '') eq 'JSON::Typist::String';
}
# }}}
# restrictions {{{
sub has_at_least_one_character {
my ($value) =
package JMAP::Validation::Tests::Boolean;
use strict;
use warnings;
sub is_boolean{
my ($value) = @_;
return (ref($value) || '') eq 'JSON::PP::Boolean';
}
1;
::Tests::SetError;
use JMAP::Validation::Tests::String;
use JSON::Typist;
use Test2::Bundle::Extended;
# record types {{{
my $typist = JSON::Typist->new();
my %ContactGroup_checks = (
id => $JMAP
{{
our $is_string = validator(sub {
my (%params) = @_;
return (ref($params{got}) || '') eq 'JSON::Typist::String';
});
# }}}
# restrictions {{{
our $is_string_or_null = in_set($is_string, U()
package JMAP::Validation::Tests::Number;
use strict;
use warnings;
sub is_number {
my ($value) = @_;
return (ref($value) || '') eq 'JSON::Typist::Number';
}
1;
Validation::Generators::String;
use strict;
use warnings;
use Data::Fake::Text;
use JSON::PP;
use JSON::Typist;
sub generate {
return JSON::Typist::String->new(join '', fake_words(4)->());
}
1;
tactInformation;
use strict;
use warnings;
use JMAP::Validation::Generators::String;
use JSON::PP;
use JSON::Typist;
my %types = (
emails => [qw{
personal
work
other
}],
phones =>
>generate(), undef) {
foreach my $isDefault (JSON::PP::true, JSON::PP::false) {
push @ContactInformation, {
type => JSON::Typist::String->new($type_value),
label
tion::Generators::File;
use strict;
use warnings;
use JMAP::Validation::Generators::String;
use JSON::Typist;
sub generate {
my $blobId = 1;
my @files;
foreach my $type (JMAP::Validation::G
each my $name (JMAP::Validation::Generators::String->generate(), undef) {
foreach my $size (JSON::Typist::Number->new(int(rand(2**32))), undef) {
push @files, {
blobId => JMAP:
gs;
use JSON::PP;
use JSON::Typist;
use JMAP::Validation::Generators::String;
sub true {
return JSON::PP::true;
}
sub false {
return JSON::PP::false;
}
sub negative_int {
return JSON::Typist
eturn JSON::Typist::Number->new(0-(rand 2**64));
}
sub zero {
return JSON::Typist::Number->new(0);
}
sub int {
return JSON::Typist::Number->new(int(rand 2**64));
}
sub real {
return JSON::Typ
ion;
use JMAP::Validation::Generators::File;
use JMAP::Validation::Generators::String;
use JSON::PP;
use JSON::Typist;
sub generate {
my ($type) = @_;
my @avatars = (
JMAP::Validation::Gener
Generators::Address::generate()],
[],
);
my @Contacts;
foreach my $isFlagged (JSON::PP::true, JSON::PP::false) {
foreach my $avatar (@avatars) {
foreach my $email (@{$ContactInfo
String->generate(),
birthday => JSON::Typist::String->new(fake_past_datetime('%Y-%m-%d')->()),
anniversary => JSON::Typist::String->new(fake_past_datetime('%Y-%m-%d'
is is a graylog logging radio through a redis database
use Moo 2;
use Redis 1.980;
use JSON 2.90 qw(encode_json);
use Time::HiRes 1.9726;
use Sys::Hostname ;
use Carp qw(croak carp);
use Scalar::Util
lf{timestamp} //= Time::HiRes::time();
# graylog seems to have problems with float values in json
# so force string, which works fine
$gelf{timestamp} = ''.$gelf{timestamp};
$gelf{sh
}
sub push {
my ($self, $gelf) = @_;
if (ref $gelf eq 'HASH') {
$gelf = encode_json($gelf);
}
$self->redis->lpush($self->queue, $gelf);
}
1;
__END__
=pod
=head1 NAME
Lo