Parser::JSON;
use Params::Validate qw( :all );
use Readonly;
use URI;
use version; our $VERSION = qv('1.0.0');
# Module implementation here
# constants
Readonly my $REGEX_FORMAT => '^(?:json|xml)$'
messages => '/1/messages.json',
users => '/1/users/validate.json',
receipts => '/1/receipts/$receipt$.json',
sounds => '/1/sounds.json',
};
},
);
= @_;
return WebService::Simple->new(
response_parser => WebService::Simple::Parser::JSON->new,
base_url => $self->base_url,
debug => $self->debug,
);
EM_SELECTED EVT_LIST_ITEM_RIGHT_CLICK EVT_MENU EVT_LIST_BEGIN_DRAG);
use base 'Wx::Notebook';
use JSON::XS ();
use Path::Tiny;
sub new {
my $class = shift;
my $parent = shift;
my $self = $class->
howModal == wxID_CANCEL;
my $path = $file_dialog->GetPath;
$file_dialog->Destroy;
my $json = eval { JSON::XS->new->utf8->pretty->encode( { $column_layout => $settings->{wrangler}->config()->{'ui.
tings::FileBrowser::SaveColumnLayout: error encoding fields: $@") if $@;
path($path)->spew_raw($json) or Wrangler::debug("Settings::FileBrowser::SaveColumnLayout: error writing column file: $path: $
8001;
use strict;
use warnings;
our $VERSION = "0.02";
use JSON::XS ();
use JSON::Color ();
my $_coder;
sub _coder {
$_coder ||= JSON::XS->new->pretty(1);
}
sub new_with_options {
my ($cla
lf, $json) = @_;
($self->{printer} ||= do {
!$self->{color} ? sub { chomp(my $l = $_coder->encode(shift)); $l} : sub { JSON::Color::encode_json(shift, {pretty => 1}) }
})->($json);
}
{
my $pre = $`;
my $maybe_json = $&;
my $post = $';
my $json;
eval {
$json = _coder->decode($maybe_json);
};
if (!$@) {
0 2013-07-01 (unreleased)
- start of new major version, branch/rewrite
- switch from YAML to JSON for settings
- new XDG config file location
- removed sidecar-file handling for now
- many
lication/json'], # exported/imported by Settings::Filebrowser, is application/json
wfl => ['Wrangler Field Layout', 'application/json'], # exported/imported by FormEditor, is application/json
wma =>
strict;
use warnings;
use IO::Async;
use Net::Async::HTTP;
use HTML::TreeBuilder qw(-weak);
use JSON::MaybeXS;
my $loop = IO::Async::Loop->new;
$loop->add(
my $ua = Net::Async::HTTP->new(
fail_o
> 'tbody'), $ddb;
binmode STDOUT, ':encoding(UTF-8)';
my $json = JSON::MaybeXS->new(
pretty => 1,
canonical => 1,
);
print $json->encode({
regions => [
map {;
my @cols = map $_->a
r_value
Returns an appropriate type (N, S, SS etc.) for the given
value.
Rules are similar to L<JSON> - if you want numeric, numify (0+$value),
otherwise you'll get a string.
=head2 type_and_value
ccount details to
it.
=cut
use Future;
use Future::Utils qw(try_repeat);
use HTTP::Request;
use JSON::MaybeXS;
use Digest::SHA qw(hmac_sha512_hex sha256_hex);
use List::Util qw(pairmap);
use List::U
get(
$self->base_url . '/api/3/depth/' . $pair
)->then(sub {
eval {
my $data = $self->json->decode(shift);
my ($lowest_ask) = nsort_by { $_->[0] } @{$data->{btc_usd}{asks}};
my ($h
,
ssl => $self->ssl,
)->then(sub {
eval {
my $body = shift;
my $data = $self->json->decode($body);
return Future->done($data->{return}) if $data->{success};
return Future->
cut
sub make_request {
my $self = shift;
my %args = @_;
my $target = $args{target};
my $js = JSON::MaybeXS->new;
my $req = HTTP::Request->new(
POST => $self->uri
);
$req->header( host => $se
namoDB_'. $self->api_version. '.'. $target );
$req->header( 'content-type' => 'application/x-amz-json-1.0' );
my $payload = $js->encode($args{payload});
$req->content($payload);
$req->header( 'Con
on-matching provides
=head1 DESCRIPTION
This distribution has a valid C<provides> entry in META.json and
META.yml with mis-matching entries with the C<.pm> files.
=over 4
=item *
CPAN::Test::Dumm
ncer::Plugin::Xslate->load({
'function' => {
'encode_json' => sub {
return JSON::encode_json(@_);
}
}
});
The second way is to the optional
named in the ruleset an actual color. It is defined using YAML (which is a superset of JSON, so you may use JSON if you prefer). The file should be built as a single section that contains a hash at t
ExtJS2
Controller::DisplayEngine::Skinny
Model::StorageEngine::DBIC
View::JSON
View::TT
);
# will auto-load other models, so this one is not -required-
if
yst::View::JSON until it is fixed, or users will get scared
# by the warning currently emitted by Catalyst
use Catalyst::View::JSON;
my $json_new = _get_subref('new', 'Catalyst::View::JSON');
{
n
o warnings 'redefine';
*Catalyst::View::JSON::new = sub {
delete $_[2]->{catalyst_component_name};
goto $json_new;
};
}
sub _get_subref {
my $sub = shift;
my $pkg = sh
->{cols}};
# filter data types coming from the db for Ext
foreach my $row (@{$c->stash->{json_data}->{rows}}) {
foreach my $col (@columns) {
my $ci = $meta->f->{$col};
earchrow{$col} = '(click to add filter)';
}
}
}
unshift @{$c->stash->{json_data}->{rows}}, \%searchrow;
}
sub filter_from_ext : Private {
my ($self, $c) = @_;
my $
cpac_dir /}
= ($page, $limit, $sortby, $dir);
$c->stash->{current_view} = 'AutoCRUD::JSON';
}
sub end : ActionClass('RenderView') {}
sub create : Chained('base') Args(0) {
my ($self
rd($c->stash->{cpac}->{g}->{backend}, 'list_stringified');
}
# send our generated config back in JSON for debugging
sub dumpmeta : Chained('base') Args(0) {
my ($self, $c) = @_;
# strip the
# delete the version as it changes
delete $c->stash->{cpac}->{g}->{version};
$c->stash->{json_data} = { cpac => {
meta => $meta,
conf => $c->stash->{cpac}->{c},
global
r} = $dir;
$c->stash->{cpac}->{g}->{frontend} = 'skinny';
}
# pull in data by forwarding to JSON .../list, then send page and render
sub browse : Chained('base') Args(0) {
my ($self, $c) = @
ew;
$pager->total_entries($c->stash->{json_data}->{total});
$pager->entries_per_page($c->stash->{cpac_skinny_limit} eq 'all'
? $c->stash->{json_data}->{total} : $c->stash->{cpac_skinny
n clients and workers,
this kind of logic is left to the applications. You can easily implement a JSON-based job broker,
for example, either by taking care of encoding/decoding in the worker code, or
ead1 DESCRIPTION
=cut
use Future;
use Future::Utils qw(try_repeat);
use POSIX qw(strftime);
use JSON::MaybeXS;
use Scalar::Util qw(reftype);
use B qw(svref_2object);
use HTTP::Request;
use WebServi
cess_key} }
sub secret_key { shift->{secret_key} }
sub api_version { '20120810' }
sub json { shift->{json} //= JSON::MaybeXS->new }
=head2 security_token
=cut
sub security_token { shift->{security_
(
# Sadly not the same key as used in DeleteTable
done => sub { my $content = shift; $self->json->decode($content)->{Table}; }
);
})
}
=head2 delete_table
Delete a table entirely.
Takes a
$row->primary_columns)
))
);
}
# create a JSON dict for this row's PK
sub _create_JSON_ID {
my $row = shift;
return undef if !defined $row or !blessed $row;
$c->stash->{cpac}->{tc};
my $meta = $c->stash->{cpac}->{tm};
my $response = $c->stash->{json_data} = {};
my @columns = @{$conf->{cols}};
my ($page, $limit, $sort, $dir) =
@{
el($meta->extra('model'))->result_source->storage->debug(1);
}
# make data structure for JSON output
DBIC_ROW:
while (my $row = $rs->next) {
my $data = {};
foreach my
package Lithium::WebDriver;
use strict;
use warnings;
use JSON::XS;
use Time::HiRes qw/sleep gettimeofday alarm/;
use LWP::UserAgent;
use MIME::Base64;
use Lithium::WebDriver::Utils;
use HTTP::Reque
__PACKAGE__,
use_eval => 0,
);
$self->{LWP}->default_header(
Content_Type => "application/json;charset=UTF-8");
# pretty sure this violates RFC 2616
push @{$self->{LWP}->requests_redirectabl
};
}
sub _parse_error
{
my ($self, $error) = @_;
my $msg = $error;
eval {
$error = decode_json $error;
$self->{error} = $error;
delete $error->{value}{screen};
$msg = $error->{value}{mes