data:
plugins:
- Datestamps
$ echo '{"hello":"world"}' | catmandu import JSON to test
$ catmandu export test to YAML
---
_id: ADA305D8-697D-11E3-B0C3-97AD572FA7E3
date_cre
="cexio-perl-module";
my $modver="0.2.3";
use vars qw($VERSION);
$cexio::VERSION = '0.2.3';
use JSON;
use Digest::SHA qw(hmac_sha256_hex);
use Hash::Flatten qw(:all);
use LWP::UserAgent;
my $ua = L
lic functions
sub ticker
{
my ($self, $primary, $secondary) = @_;
return $o->unflatten( $self->_json_get($cexio{urls}{api}{ticker}.$primary."/".$secondary) );
}
sub order_book
{
my ($self, $primar
@_;
if ( defined($depth) ) { $secondary .= "/?depth=${depth}"; }
return $o->unflatten( $self->_json_get($cexio{urls}{api}{order_book}.$primary."/".$secondary) );
}
sub trade_history
{
my ($self,
aller;
$Sensu::API::Client::APICaller::VERSION = '0.02';
use 5.010;
use Moo::Role;
use Carp;
use JSON;
use HTTP::Tiny;
our @CARP_NOT = qw/ Sensu::API::Client /;
has ua => (
is => 'ro',
def
is => 'ro',
default => sub { {
'Accept' => 'application/json',
'Content-type' => 'application/json',
}; },
);
sub get {
my ($self, $url) = @_;
my $r = $self->u
? decode_json($r->{content}) : 1;
}
sub post {
my ($self, $url, $body) = @_;
my $post = { headers => $self->headers };
if (defined $body) {
$post->{content} = encode_json($body);
Libs ------------------------------------------------
use XML::Simple qw(:strict);
use Carp;
use JSON::XS;
use Encode;
#------------------------- Subs -----------------------------------------------
# convert_if_marked_encoded
# DESCRIPTION
# Tries to JSON-decode and flatten a value to a plain string if the key has been marked as JSON in the whitelist.
# Other encodings may follow in futur
e.
# INPUT
# HASHREF
# + key
# + value
# OUTPUT
# The JSON-decoded and flattened 'value' if key is marked JSON. Plain keys and values, newline separated.
# Untouched 'value' otherwise.
#
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("
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
>
<param>
<key>uid</key>
</param>
<param>
<key>json_value</key>
<encoding>json</encoding>
</param>
<param>
<key>login_password</key>
* encoding
Use value I<json> if the parameter contains JSON encoded data. IDS will test the decoded data,
otherwise a false positive would occur due to the 'suspicious' JSON encoding characters.
=i
matching rule for this key.
=item * I<enc>: value contains encoding
Filtered due to containing (JSON) encoding for this key.
=back
=back
=over 4
=item C<$ids-E<gt>{non_filtered_keys}>
=over 4
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
talystX::CRUD view
=head1 SYNOPSIS
use CatalystX::CRUD::YUI::TT;
# in a template
[% foo.as_json %]
[% foo.dump_data %]
[% foo.dump_stderr %]
[% SET foo = 1;
foo.increment; # foo == 2
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 ||
r::Version::VERSION;
our %options = (
'debug' => 0,
'folders' => [],
'output_file' => 'output.json',
);
use Data::Dumper;
has 'search' => (is => 'rw', isa => 'PMInfoExtr::Search');
has 'dpkg' =
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
Carp qw(confess);
use Log::Log4perl qw(:easy);
use REST::Client;
use URI::Template;
use JSON;
my $json = JSON->new->allow_nonref;
=head1 NAME
Usergrid::Request - Role that provides HTTP invocation
er('Authorization',
'Bearer ' . $self->user_token->{'access_token'});
}
my $json_req = $self->json_encode($request) if ($request);
$client->DELETE($resource) if ($method eq 'D
rce) if ($method eq 'GET');
$client->POST($resource, $json_req) if ($method eq 'POST');
$client->PUT($resource, $json_req) if ($method eq 'PUT');
my $response = $client->responseCo
base 'Class::Accessor::Fast';
use MRO::Compat;
use mro "c3";
use Scalar::Util qw( blessed );
use JSON::XS ();
use Data::Dump qw( dump );
__PACKAGE__->mk_accessors(qw( datetime_format yui html_escape
RIPTION
CatalystX::CRUD::YUI::Serializer turns objects into hashrefs,
typically for rendering as JSON.
=head1 METHODS
Only new or overridden method are documented here.
=cut
=head2 new
Instanti
default_view => 'YUI',
fmt_to_view_map => {
'html' => 'YUI',
'json' => 'YUI',
'xls' => 'Excel',
},
);
our $VERSION = '0.031';
=head1 NAME
CatalystX:
default_view => 'YUI',
fmt_to_view_map => {
'html' => 'YUI',
'json' => 'YUI',
'xls' => 'Excel',
},
);
1;
=head1 DESCRIPTION
This is a base cont
}
}
return $self;
}
=head2 json_mime
Returns JSON MIME type. Default is 'application/json; charset=utf-8'.
=cut
sub json_mime {'application/json; charset=utf-8'}
=head2 default
Redir
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
}
}
}
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
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-
use strict;
use warnings;
use Bot::Cobalt;
use Bot::Cobalt::Common;
use HTTP::Tiny;
use JSON qw(decode_json);
my $URBAN_API = 'http://api.urbandictionary.com/v0';
sub new { bless {}, shift }
sub
TP::Tiny->new->get($url);
my $json = decode_json($resp->{content});
my $total = scalar(@{$json->{list}});
my $idx = int(rand($total));
my $entry = $json->{list}->[$idx];
my $example
HTTP::Tiny->new->get($url . "term=$term");
my $json = decode_json($resp->{content});
my $total = scalar(@{$json->{list}});
my $entry = $json->{list}->[$idx];
if (not defined $entry) {
ams = { } ;
# new page
my $out = $obj->process( 'page', $content, $params) ;
# yamlasjson
$content = "list:
- array: [1,2,3,7]
channel: BBC3
date: 2013-10-20
annel: BBC4
date: 2013-11-20
time: 21:00
" ;
$out = $obj->process( 'yamlasjson', $content, $params) ;
# table
$content = "row1,entry 1,cell2
row2,cell1, entry 2
(Load);
use JSON;
use Moo;
use App::Basis::ConvertText2::Support;
use namespace::clean;
has handles => (
is => 'ro',
init_arg => undef,
default => sub { [qw{yamlasjson table versi