----------------------
sub _metapath
{
my ($mod) = @_;
my $metapath;
for my $ext (qw/json yml/) {
my $p = catfile($mod->status->extract, "META.$ext");
if (-f $p) {
return if ( $d eq $b );
}
return $d;
}
#--- PRIVATE METHOD ---
# We read the META.json or META.yml file with Parse::CPAN::META and extract
# data needed for makedepends and pkgdesc if
odobj) = ($self->status, $self->parent);
# Leave metareqs undef if there is no META.yml/META.json.
my $path = _metapath($modobj) or return;
my $meta = eval { Parse::CPAN::Meta::LoadFi
int "Report data...\n" if $self->{verbose} or $self->{debug};
my $res = $ua->post($url => json => $data)->res;
print "Done.\n" if $self->{verbose} or $self->{debug};
die "benc
se JSON::MaybeXS;
BEGIN { extends 'Catalyst::Controller::REST' }
__PACKAGE__->config(
default => 'application/json',
'map' => {
'application/json' => 'JSON',
'text/x-json'
=> 'JSON',
},
);
sub end : Private {
my ( $self, $c ) = @_;
#... do things before Serializing ...
my $code = $c->res->status;
if ( scalar( @{ $c->error } ) ) {
$code
alystX::Eta::Controller::TypesValidation;
use Moose::Role;
use Moose::Util::TypeConstraints;
use JSON::MaybeXS;
sub validate_request_params {
my $self = shift;
my ( $c, %fields ) = @_;
the command line
$ catmandu convert Zotero --userID <userID> to JSON
$ catmandu convert Zotero --groupID <groupID> to JSON
# From Perl
use Catmandu;
my $importer = Catmandu->i
N
use Mojo::Base -base;
use XTaTIK::Model::Products;
use XTaTIK::Model::Quote;
use Mojo::Pg;
use JSON::Meth;
use experimental 'postderef';
has [qw/
pg
/];
sub all {
my $self = shift;
ION = '0.005002'; # VERSION
use Mojo::Base -base;
use XTaTIK::Model::Products;
use Mojo::Pg;
use JSON::Meth;
use experimental 'postderef';
my @ACCESSORS = qw/contents created_on
address1 addre
N
use Mojo::Base -base;
use XTaTIK::Model::Products;
use XTaTIK::Model::Quote;
use Mojo::Pg;
use JSON::Meth;
use experimental 'postderef';
my $Blank_Cart_Data = {
contents => [],
total =
4.0;
my $VERSION = 0.11;
my $URL_FORMAT = "http://geohex.net/testcase/hex_v${VERSION}_test_%s.json";
my @CASES = qw!
XY2HEX
code2HEX
code2XY
coord2HEX
coord2XY
!;
my @EXTRA =
use File::Temp qw/tempdir/;
use File::Basename qw/dirname/;
use File::Spec;
use HTTP::Tiny;
use JSON::PP;
main();
sub main {
my $dir = tempdir(CLEANUP => 1);
# download
my $ua = HTTP:
$dir, "$case.json");
my $res = $ua->mirror($url, $path);
die "Failed: $res->{reason}" unless $res->{success};
}
# parse & generate
my @src;
my $json = JSON::PP->new;
Mojo::Base 'Mojo::UserAgent';
use Mojo::Parameters;
use Mojo::URL;
use Mojo::UserAgent;
use Mojo::JSON 'j';
use Mojo::Util 'slurp';
use Mojo::Collection 'c';
use Mojo::Cloudstack::Base;
use Mojo::Clou
LOAD;
chomp(our $user = `whoami`);
our $cf = File::HomeDir->users_home($user) . "/.cloudmojo/api.json";
sub _build_request {
my ($self, $params) = @_;
my $baseurl = sprintf ("%s://%s:%s%s?", $se
, $self->port, $self->path);
$params->{ apiKey } = $self->api_key;
$params->{ response } = 'json';
my $secret_key = $self->secret_key;
my $req_params = Mojo::Parameters->new();
foreach my
qw(confess cluck);
use Tk;
use Tk::Photo;
use Tk::PNG;
use Tk::JPEG;
use Data::Dumper;
use JSON;
use Try::Tiny;
## Version string
our $VERSION = qq{0.05};
## Used when importing a form,
($param)
=over 2
=item B<Description>
initialize the form from a HASH reference, JSON string, or JSON file.
In all cases, the hash should have the following format
{
title =>
ng',
},
]
}
=item B<Parameters>
$param - HASH reference, or scalar containin JSON string, or filename
=item B<Return>
NONE
=back
=cut
##----------------------------
2'; # VERSION
use Mojo::Base 'Mojolicious::Controller';
use experimental 'postderef';
use JSON::Meth qw/$json/;
sub login {
my $self = shift;
my $user = $self->users->check(
$self->
self->config('site') )->@*;
my @list;
for ( @prods ) {
my $pr = $_->{price_raw}->$json->{ $self->config('site') };
if ( ref $pr ) {
$pr = join ',', map "${_}_$pr->{
qw/sort_by extract_by/;
use Scalar::Util qw/blessed/;
use experimental qw/postderef/;
use JSON::Meth qw/$json/;
use autobox;
sub SCALAR::split_comma { [ split /\s*,\s*/, $_[0] ] }
has [qw/pg prici
} }
$values{sites} //= 'default';
$values{price} //= { default => { '00' => '0.00' } }->$json;
return $self->pg->db->query(
'INSERT INTO products (number, image, title,
/g;
# Remove site's pricing
my $p = $_->{price}->$json;
delete $p->{ $site };
$_->{price} = $p->$json;
$self->pg->db->query(
q{UPDATE products SET
rom the command line
$ catmandu convert Zotero --userID <userID> to JSON
$ catmandu convert Zotero --groupID <groupID> to JSON
# From Perl
use Catmandu;
my $importer = Catmandu->importer
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
:App::Openqq::SendMessage;
use parent qw(Plack::Component);
use URI::Escape qw(uri_unescape);
use JSON;
use Encode;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shi
};
my $json = JSON->new->utf8->encode($res);
$responder->([
200,
['Content-Type' => 'text/plain'],
[$json],
]);
use JSON;
sub Webqq::Client::_get_group_sig {
my $self = shift;
my($id,$to_uin,$service_type,) = @_;
my $cache_data = $self->{cache_for_group_sig}->retrieve("$id|$to_uin|$service_type");
nt() if $self->{debug};
my $json = JSON->new->utf8->decode($response->content());
return undef if $json->{retcode}!=0;
return undef if $json->{result}{value} eq "";
$s
elf->{cache_for_group_sig}->store("$id|$to_uin|$service_type",$json->{result}{value},300);
return $json->{result}{value} ;
}
else{return undef}
}
1;
use JSON;
use Webqq::Client::Util qw(code2state);
sub Webqq::Client::_get_friend_info{
my $self = shift;
my $uin = shift;
my $api_url = 'http://s.web2.qq.com/api/get_friend_info2';
my
" if $self->{debug};
my $json = JSON->new->utf8->decode( $response->content() );
return undef if $json->{retcode} !=0;
my $user_info = $json->{result};
for my $key
0;
use strict;
use warnings;
our $VERSION = '0.001001';
use Carp qw/croak/;
use HTTP::Tiny;
use JSON::MaybeXS;
use Scalar::Util qw/blessed/;
my $ht = HTTP::Tiny->new(
agent => "WebService-Sca
s->{headers}{'X-Auth-Token'} = $$self if $$self;
$opts->{headers}{'Content-Type'} = 'application/json';
my $ret = $ht->request($method, $url, $opts);
die 'Request to Scaleway API server was unsucce
. $ret->{status} . ' ' . $ret->{reason} . '; ' . $ret->{content} unless $ret->{success};
decode_json $ret->{content} if $ret->{status} != 204;
}
sub _get { shift->_request(GET => @_) }
sub _p
penqq::SendDiscussMessage;
use parent qw(Plack::Component);
use URI::Escape qw(uri_unescape);
use JSON;
use Encode;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shi
};
my $json = JSON->new->utf8->encode($res);
$responder->([
200,
['Content-Type' => 'text/plain'],
[$json],
]);