package Mojolicious::Plugin::Recaptcha;
use strict;
use Mojo::ByteStream;
use Mojo::JSON;
use base 'Mojolicious::Plugin';
our $VERSION = '0.61';
sub register {
my ($self,$app,$conf) = @_;
$conf
$options->{'ssl'};
my $scheme = ($conf->{'ssl'}) ? 'https' : 'http';
my $r_options = Mojo::JSON->new()->encode($options);
$app->renderer->add_helper(
recaptcha_html => sub {
my $self = sh
ept: text/html form_field_name form_field_value
$ ./myapp POST / Content-Type: text/json Content: '{ "json": "here" }'
The body of the response is sent to STDOUT and the headers to STDERR, so
est_request(
POST => '/',
'Content-Type:' => 'text/json',
'Content:' => '{ "json": "here" }',
);
=head1 AUTHORS
See L<Web::Simple> for authors.
t using this
while (my $dump = <$fh>) {
next if not $dump =~ /\S/;
foreach my $type (qw(json yaml simple)) {
eval {$tmphist = Math::SimpleHisto::XS->new_from_dump($type, $dump);};
%params = (
'key' => $key,
'appkey' => $self->{'account'}->{'appkey'},
);
my $json_hash_ref;
eval {
$json_hash_ref = send_request($self->{'account'}, 'kvs/delete', \%params);
};
# Re-raise
}
return $json_hash_ref->{'result'};
}
sub get {
my ($self, $key, $raise_not_found) = @_;
my %params = (
'key' => $key,
'appkey' => $self->{'account'}->{'appkey'},
);
my $json_hash_ref;
alue, when present (may be serialized).
# De-serialize $value data-structure.
my $value = thaw($json_hash_ref->{'value'});
$value = ${ $value } if (ref($value) eq "SCALAR");
return $value;
}
sub
Moose;
use JSON;
use Scalar::Util qw(weaken);
use namespace::autoclean;
with qw(KiokuDB::TypeMap::Entry);
has json => (
isa => "Object",
is => "ro",
default => sub { JSON->new },
);
sub compile {
my ( $self, $class ) = @_;
my $json = $self->json;
return KiokuDB::TypeMap::Entry::Compiled->new(
collapse_method => sub {
my ( $collapser, @args ) = @
id_method => sub {
my ( $self, $object ) = @_;
return 'dbic:row:' . $json->encode([ $object->result_source->source_name, $object->id ]);
},
refresh_method
pan:NUFFIN';
}
{
$KiokuDB::TypeMap::Entry::DBIC::ResultSet::VERSION = '1.22';
}
use Moose;
use JSON;
use Scalar::Util qw(weaken);
use namespace::autoclean;
extends qw(KiokuDB::TypeMap::Entry::Nai
ga::Result;
use File::Which qw(which);
use List::MoreUtils qw(any);
use URI;
use URI::Escape;
use JSON;
use Try::Tiny;
use Encode;
use base qw(Class::Accessor::Fast);
our $VERSION = '0.08';
__PACKAG
$url,
sub {
my $json = shift;
my $result;
try {
my $data = JSON->new->utf8->decode($json);
$result = AnyEvent::Groon
$cmd_cv->cb(
sub {
my $json = $stdout;
my $result;
try {
my $data = JSON->new->utf8->decode($json);
$result = AnyEvent::Groo
Auth;
use Any::Moose;
with 'Net::OpenStack::Compute::AuthRole';
#use Data::Dumper;
use JSON qw(from_json to_json);
use LWP;
has _info => (is => 'ro', lazy => 1, builder => '_build_info');
has base_
content_type => 'application/json', content => to_json($auth_data));
die $res->status_line . "\n" . $res->content unless $res->is_success;
my $data = from_json($res->content);
my $token
onds
);
my $json_hash_ref = send_request($self->{'account'}, 'feeds/register', \%params);
# Return true on success.
if (exists($json_hash_ref->{'result'}) and ($json_hash_ref->{'re
rl,
);
my $json_hash_ref = send_request($self->{'account'}, 'feeds/unregister', \%params);
# Return true on success.
if (exists($json_hash_ref->{'result'}) and ($json_hash_ref->{'r
Server::Core;
use strict;
use HTTP::Headers;
use HTTP::Request;
use LWP::UserAgent;
use URI;
use JSON;
use Data::Dumper;
use Echo::StreamServer::Settings;
# =======================================
====================================================================
# REST API: Document Format: JSON
# ======================================================================
my $HTTP_HEADERS = HTTP
L $VERSION)");
$HTTP_HEADERS->header('Accept' => 'application/json');
$HTTP_HEADERS->header('Content-Type' => 'application/json');
# ============================================================
mpute;
use Moose;
our $VERSION = '1.1002'; # VERSION
use Carp;
use HTTP::Request;
use JSON qw(from_json to_json);
use LWP;
has auth_url => (is => 'rw', required => 1);
has user => (is =
params);
my $res = $self->_get($self->_url("/servers", $params{detail}, $q));
return from_json($res->content)->{servers};
}
sub get_server {
my ($self, $id) = @_;
croak "Invalid serve
elf->_get($self->_url("/servers/$id"));
return undef unless $res->is_success;
return from_json($res->content)->{server};
}
sub get_servers_by_name {
my ($self, $name) = @_;
my $server
pkey'},
'q' => $query,
);
my $json_hash_ref = send_request($self->{'account'}, 'count', \%params);
if ($DEBUG) { print STDERR "count returned: " . Dumper($json_hash_ref) . "\n"; }
# Ret
urn count or zero when impossible.
if (exists($json_hash_ref->{'count'})) {
return $json_hash_ref->{'count'};
}
else {
return 0;
}
}
sub searc
arams{'since'} = $since;
}
my $json_hash_ref = send_request($self->{'account'}, 'search', \%params);
# Return results data structure.
return $json_hash_ref;
}
sub submit {
my ($s
=============================
# JSON.pm calls TO_JSON() method on the blessed hash.
#
# NOTE: The convert_blessed flag must be set (false by default).
# my $json = JSON->new->convert_blessed;
# ======
================================================================
use JSON;
my $json = JSON->new->convert_blessed;
our @USER_SUBJECTS = ( 'roles', 'state', 'markers', 'poco' );
sub get {
my ($self,
$raise_not_found) = @_;
my %params = (
'identityURL' => $identity_url,
);
my $json_hash_ref;
eval {
$json_hash_ref = send_request($self->{'account'}, 'users/get', \%params);
};
# Re
package App::Beeminder::Hook;
use Dancer ':syntax';
use JSON::Any;
use autodie;
use Data::Dumper;
# ABSTRACT: Integrate Github and Beeminder
our $VERSION = '0.1';
# inspired by https://github.com/s
ram('payload');
unless ($p) {
my $response = JSON::Any->encode( { success => 0 } );
return $response;
}
$p = JSON::Any->new->decode( $p );
debug(Dumper($p));
my
config->{beeminder_goal},
);
debug "Running: $cmd";
system $cmd;
my $response = JSON::Any->encode( { success => 1 } );
};
get '/' => sub {
'This is App::Beeminder::Hook';
};
tr
e);
}
1;
__END__
=head1 NAME
Ambrosia::View::JSON - it is VIEW in MVC.
=head1 VERSION
version 0.010
=head1 DESCRIPTION
C<Ambrosia::View::JSON> - it is VIEW in MVC.
Returns result in XML or HT
ts::Datatype::Duration->new($this->{i}->duration);
return $this->{i}->start . "/$D";
}
sub TO_JSON
{
my $this = shift;
return $this->to_string;
}
=item C<< $d->datatype >>
Returns an the RDF d
scriptName//;
my ($response_type, $resource_type, $resource_id) = ( $uri =~ m{/?(?:(html|xml|json|atom|rss)/)?([^?\\\/]*)(?:/([^?\\\/]+)?)?} );
$self->response_type = lc($response_type) || '
ar) string.
=back
=cut
sub to_string
{
my $this = shift;
return $this->{'string'};
}
sub TO_JSON
{
my $this = shift;
return $this->{'string'};
}
=head2 Functions
=over 4
=item C<< $str = ms
EntityCode($hDir{dirTemplates}, $tmplPath . '/Templates/Templates/' . $tpl_path . '/edit_json.xsl', '_edit_json' . $ex, 1, '@Type!="BIND" and @Type!="VIEW"');
copy($tmplPath . '/Templates/Template
y $style_doc = $self->parser->parse_file($tmplPath . '/Templates/Templates/' . $tpl_path . '/list_json.xsl');
($style_doc->getElementsByLocalName('output'))[0]->setAttribute( encoding => $enco
y $results = $stylesheet->transform($self->source);
my $fn = $hDir{dirTemplates} . '/list_json.xsl';
if ( -e $fn )
{
rename $fn, $fn . '.bak';
}
#if
.
=cut
sub data
{
return {} unless defined $_[0]->{'DATA'};
return $_[0]->{'DATA'};
}
sub TO_JSON
{
return data( $_[0] );
}
=item C<< $object->element >>
Returns the root element.
=cut
sub