ex::API::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/trades.json';
use constant ATTRIBUTES => qw(currencypair days startdate enddate);
use constant DATA_KEY =>
andu::Util qw(data_at);
use Catmandu;
sub description {
<<EOS;
examples:
# export config to JSON
catmandu config
# or any other Catmandu::Exporter
catmandu config to YAML --fix 'delete_field(pas
Catmandu->exporter($into_args->[0], $into_opts);
} else {
$into = Catmandu->exporter('JSON', pretty => 1);
}
$into->add(defined $path ?
data_at($path, Catmandu->config
gging methods for the
defined log levels, such as C<debug> or C<error>.
package MyApp::View::JSON;
extends 'MyApp::View';
with 'Catmandu::Logger';
sub bar {
$self->log->info
}
Your package automatically has a logging category of MyApp::View::JSON. Use lines like:
log4perl.logger.MyApp::View::JSON=DEBUG,STDOUT
or
log4perl.logger.MyApp::View=DEBUG,STDOUT
or
o.martins@caixamagica.pt>
package PMInfoExtr::Report;
use strict;
use warnings;
use Moose;
use JSON;
use UUID::Tiny ':std';
use PMInfoExtr::Version;
our $VERSION = $PMInfoExtr::Version::VERSION;
$self->print_array_to_json($data);
return;
}
sub print_array_to_json {
my $self = shift;
my $data = shift;
my $json = JSON->new->utf8;
$json->convert_blessed(1);
$json->allow_blessed(1);
m
ing(create_uuid()),
format => {
id => "d7f5e025-9daa-11e3-ab53-e3e54faab75e",
multiple => JSON::false,
},
);
if (defined $PMInfoExtr::Manager::options{'output_file'}) {
unlink $PMInfoEx
package App::Midgen::Role::Output::METAjson;
use constant {
BLANK => q{ },
NONE => q{},
THREE => q{ },
SIX => q{ },
NINE => q{ },
TWELVE => q{ },
};
use Moo:
red );
use Data::Printer {caller_info => 1,};
use File::Spec;
#######
# header_metajson
#######
sub header_metajson {
my $self = shift;
my $package_name = shift || NONE;
$package_name =~ s{::}{-}g
\n";
print THREE . '"version" : "...",' . "\n";
}
return;
}
#######
# body_metajson
#######
sub body_metajson {
my $self = shift;
my $title = shift;
my $required_ref = shift ||
alystX::CRUD::Controller::RHTMLO
with some additional/overridden methods for working with YUI and JSON.
=head1 METHODS
=cut
=head2 autocomplete_columns
Should return arrayref of fields to search w
py( file( $cx_crud_yui_tt_path, 'static', 'js', 'json.js' ) . '',
file( $js_dir, 'json.js' ) . '' )
or warn "ERROR: failed to copy json.js to local static/js\n";
copy( file( $cx_cr
->config(
default_view => 'RDGC',
fmt_to_view_map => {
html => "RDGC",
json => "RDGC",
xls => "Excel"
},
);
1;
EOF
}
sub _make_base_rdbo_model {
my $self
ch records are dumped.
=item $format (default: 'sql')
Output format. Choices are B<'sql'> or B<'json'>.
=item $pretty (default: false)
Boolean value whether to print output prettily.
=item $bytes
package Data::Generator::FromDDL::Formatter;
use strict;
use warnings;
use Carp qw(croak);
use JSON ();
use Class::Accessor::Lite (
new => 1,
rw => [qw(format pretty bytes_per_sql)],
);
sub t
($self->format =~ /sql/i) {
'to_sql';
} elsif ($self->format =~ /json/i) {
'to_json';
} else {
croak("Unsupported format: " . $self->format . "\n");
$sqls;
}
sub to_json {
my ($self, $table, $fields, $rows) = @_;
my $json = do {
if ($self->pretty) {
JSON->new->pretty;
} else {
JSON->new;
}
ivate> API method C<$method> (with the given C<$params>, where applicable) and returns either the JSON encoded result string or an error message (C<code> C<message>).
=back
=head1 DEPENDENCIES
=ove
k::Kraken;
use JSON;
my $kraken = new Finance::Bank::Kraken;
my $res = $kraken->call(Public, 'Ticker', ['pair=XLTCZEUR,XXBTZEUR']);
printf "1 XLTC is %f EUR\n",
from_json($res)->{'resul
unless $res =~ /^5/;
=head2 get XLTC account balance
use Finance::Bank::Kraken;
use JSON;
my $kraken = new Finance::Bank::Kraken;
$kraken->key("mysupersecretkey");
$kraken->secret("
RESTModel:
MyData:
server: http://localhost:5000
type: application/json
clientattrs:
timeout: 5
then use it from any of your routes/controllers:
##########################################
# sexp encoding
# (This code is based on Mojolicious's JSON library.)
# Translate an argument object into S-expression text.
sub to_sexp {
my $arg = shift
}
}
}
if ($clean) {
unlink "output.json";
}
if (-e "output.json") {
open my $output, "<", "output.json" || die ("Can't open file output.json. $!");
my $data = <$output>;
print STDOU
r::Version::VERSION;
our %options = (
'debug' => 0,
'folders' => [],
'output_file' => 'output.json',
);
use Data::Dumper;
has 'search' => (is => 'rw', isa => 'PMInfoExtr::Search');
has 'dpkg' =
package App::Nopaste::Service::dpaste;
use strict;
use warnings;
use JSON ();
our $VERSION = '0.03';
our $SYNTAX_CHOICES_URL = 'http://dpaste.com/api/v2/syntax-choices/';
use base 'App::Nopaste::
URL: @{[$res->status_line()]}"
unless $res->is_success();
$mech->back();
return JSON->new->decode($res->content());
}
sub return {
my ($self, $mech) = @_;
my $link = $mech-
shift;
my $url = 'http://cdn.api.twitter.com/1/urls/count.json?url=' . $self->url;
if ( my $share_count = $self->get_url_json($url)->{count} ) {
return $share_count || 0;
}
my $url = 'http://www.reddit.com/api/info.json?url=' . $self->url;
if ( my $json = $self->get_url_json($url) ) {
if ( my $data = $json->{data} ) {
if ( my $children = $d
e Data::Dump qw( dump );
use MRO::Compat;
use mro "c3";
use base qw( Class::Accessor::Fast );
use JSON::XS ();
use Scalar::Util qw( blessed );
use CatalystX::CRUD::YUI::Serializer;
our $VERSION = '0.
An arrayref of column hashrefs. YUI LiveGrid API requires these.
=item url
The url for fetching JSON results.
=item show_related_values
A hashref of foreign key information.
=item col_filter
An
$field_name ),
sortable => ( $isa_field || $isa_chain )
? JSON::XS::true()
: JSON::XS::false(),
sort_prefix =>
( $form->metadata->sort
lt()> is the most important attribute of the resonse I will be giving you a sample result data in JSON notation for your reference.
=head2 new(access_key => $key, secret_key => $s_key)
=head2 ne
. See L<Response class|Net::AWS::SES::Response>.
Sample successful response looks like this in JSON:
{
"MessageId": "00000141344ce1a8-0664c3c5-e9a0-4b47-aa2e-12b0bdf6070e-000000"
umented API queries must have respective methods in the library.
=back
=head1 SEE ALSO
L<JSON>, L<MIME::Base64>, L<Digest::HMAC_SHA1>, L<LWP::UserAgent>, L<Net::AWS::SES::Response>, L<XML::Si
package URL::Social::BASE;
use Moose;
use namespace::autoclean;
use LWP::UserAgent;
use JSON;
=head1 NAME
URL::Social::BASE - Base class for the different social classes.
=head1 DESCRIPTION
You d
);
sub _build_useragent {
my $self = shift;
return LWP::UserAgent->new;
}
sub get_url_json {
my $self = shift;
my $url = shift || $self->url;
if ( $url =~ m,(file://.+), ) {
esponse = $self->useragent->get( $url );
if ( $response->is_success ) {
return JSON::decode_json( $response->content );
}
else {
return undef;
}
}
#
# The End
#
__PAC