s;
use Carp;
use Digest::SHA1 qw/sha1_hex/;
use Encode qw/encode_utf8 decode_utf8/;
use Furl;
use JSON ();
use constant IM_KAYAC_BASE_URL => 'http://im.kayac.com/api/post/';
our $VERSION = '0.10';
s) {
croak "[ERROR] " . $res->status_line;
}
my $json = JSON::decode_json($res->{content});
if (my $error = $json->{error}) {
croak "[ERROR] $error";
}
}
1;
__END__
See also L<Coro>.
=back
=head2 JSON
=over 4
=item L<JSON::XS>
JSON::XS is pretty fast. I'm use this for the point what needs performance.
=item L<JSON::PP>
JSON::PP is written in pure perl. And
S|Newick|PhyloXML|NeXML
'dataformat', # NEXUS|PHYLIP|FASTA|Stockholm
'metaformat', # tsv|JSON|csv
],
@_,
);
return $self;
}
=item response_header
Returns the MIME-type HTTP header
my $changes = CPAN::Changes->load('Changes');
my $meta = CPAN::Meta->load_file('META.json');
my $doap = RDF::DOAP::Lite->new(meta => $meta, changes => $changes);
$doap->doap_
use strict;
use warnings;
# for now, check switching to HTTP::Tiny or Hijk
use LWP::Simple;
use JSON;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(
start_btsync
set_config
set
cally, you need
to name it btconfig and add its path to the environment path variable.
Sync uses JSON format for the configuration file.
Here is a sample config file that you can use to enable API:
t the listened address from.
Alternatively, you can use set_listened_address.
returns the config JSON parsed to a Perl HashRef.
=over 4
=item config_file (required)
Specifies path to the config fi
)
|| die IO::Socket::SSL::errstr();
=cut
my $json_header = HTTP::Headers->new('Content-Type' => 'application/json');
$self->Log('info', 'OneTool Daemon API listening on ' . $d
params, $content);
my $resp =
HTTP::Response->new(200, 'OK', $json_header, $resp_content);
$connection->send_response($resp);
}
OneTool Configuration module
=cut
use strict;
use warnings;
use FindBin;
use File::Slurp;
use JSON;
my $DIR_CONFIG = "$FindBin::Bin/../conf";
=head1 FUNCTIONS
=head2 Directory($directory)
Sets
)
);
if ((defined $file) && (-r $file))
{
my $json_str = read_file($file);
my $conf = from_json($json_str);
return ($conf);
}
return (undef);
}
1;
type);
}
sub is_binary {
my $mime_type = shift;
$mime_type !~ /\b(?:text|xml|javascript|json)\b/;
}
sub get_stuff {
my ($self, $path, $query) = @_;
my $key = $path . $query;
if
e App::DeDuppy;
# ABSTRACT: generate json files from casperjs test arguments
use strict;
use warnings;
use 5.010;
use Carp;
use Moo;
use MooX::Options;
use JSON;
option 'arglist' => (is => 'ro',
default => sub { [] });
sub truthify_maybe {
$_[0] eq 'false' ? JSON::false :
$_[0] eq 'true' ? JSON::true : $_[0];
}
sub arrayrefify_maybe {
my @values = split(/,/, $_[0]
$+{value});
$self->options->{$option} = defined $value ? arrayrefify_maybe($value) : JSON::true;
} else {
if ($self->subcommand_is_set) {
push @{$se
rency.
This module provides high and low level APIs for managing a running
bitcoin instance over JSON-RPC.
=head1 BUGS
Please report any bugs to L<http://rt.cpan.org/>.
=head1 SEE ALSO
L<Finance:
to pass test configurations as json files
use strict;
use warnings;
use Moo;
use MooX::Options;
use IPC::Run qw/run new_chunker/;
use File::Which;
use IO::All;
use JSON;
use DDP;
use Carp;
use Try::T
=> 'rw',
required => 1,
format => 's@',
doc =>
'Test option: one ore more json file(s) containing the casperjs tests to perform'
);
option 'casper_path' => (
is =>
my $content = io($file)->slurp;
try {
$ret->{$file} = decode_json($content);
}
catch {
carp "'$file' is not valid: $_";
;
}
sub addresses
{
my ($self) = @_;
my $list = $self->api->call('listreceivedbyaddress', 0, JSON::true);
return unless ref($list) eq 'ARRAY';
return
map { "Finance::Bitcoin::Address"->new
unning
Bitcoin instance.
=over 4
=item C<< new($endpoint) >>
Constructor. $endpoint may be the JSON RPC endpoint URL, or may be a
Finance::Bitcoin::API object.
=begin trustme
=item BUILDARGS
=en
ct;
use warnings;
use Any::URI::Escape qw(uri_escape);
use JSON;
use Search::Elasticsearch::Util qw(throw parse_params);
use Carp;
has 'JSON' => ( is => 'lazy' );
has '_base_qs' => ( is => 'ro',
', @$vals );
},
);
#===================================
sub _build_JSON {
#===================================
JSON->new->utf8(1);
}
#===================================
sub _build_builder
s}
? $params->{post_process}->($result)
: $result;
return $params->{as_json} ? $self->JSON->encode($result) : $result;
}
#===================================
sub use_index {
#===
VKontakte::Standalone;
use 5.006000;
use strict;
use warnings;
use URI;
use WWW::Mechanize;
use JSON;
use Carp;
our $VERSION = '0.18_95';
sub import {
my $class = shift;
return unless @_;
my %o
= "password";
$params{client_id} = $self->{api_id};
REDO: { # for CAPTCHA
my $result = decode_json $self->_request(\%params, "https://oauth.vk.com/token")->decoded_content;
if ($result->{access_
cope"});
}
$params->{access_token} = $self->{access_token};
REQUEST: {
my $response = decode_json $self->_request($params,"https://api.vk.com/method/$method")->decoded_content;
if ($response->{
tcoin instance.
=over 4
=item C<< new($endpoint, $string) >>
Constructor. $endpoint may be the JSON RPC endpoint URL, or may be a
Finance::Bitcoin::API object; $string is an address string.
=begin
::Simple::Authen
=item * IO::Capture::Stderr
=item * IO::Socket::SSL
=item * IPC::Run
=item * JSON
=item * LWP
=item * LWP::Protocol::https
=item * Module::Install
=item * Net::IP
=item * Net
scroll} ||= '1m';
my $method = $params->{q} ? 'searchqs' : 'search';
my $as_json = delete $params->{as_json};
my $results = $es->$method($params);
my $self = {
_es =
max_score},
_facets => $results->{facets},
_eof => 0,
_as_json => $as_json,
};
return bless( $self, $class );
}
#===================================
sub ne
my @results = splice @{ $self->{_buffer} }, 0, $size;
return
$self->{_as_json} ? $self->{_es}->JSON->encode( \@results )
: $size == 1 ? $results[0]
:
d2 JSON
=over 4
=item L<JSON|JSON>
Basic perl module to parse JSON
=item L<JSON::Any|JSON::Any>
Auto use the best available JSON module
=item L<JSON::XS|JSON::XS>
Fast C module to parse JSON
=
item L<MooseX::Types::IPv4|MooseX::Types::IPv4>
IP Address
=item L<MooseX::Types::JSON|MooseX::Types::JSON>
A JSON string
=item L<MooseX::Types::NetAddr::IP|MooseX::Types::NetAddr::IP>
Alternativ
AML::Syck>
Another fast module to parse YAML
=item L<YAML::XS|YAML::XS>
Fast C module to parse JSON
=back
=head1 INSTALLATION
See perlmodinstall for information and options on installing Perl mo
} =~ /^(turtle|n.?triples|n.?quads|trig|n3|notation.?3|pret|pretdsl|sparql|sparql.?(update|query)|json|xml)$/i;
return $self->_syntax_highlighting_for_text_via_kate(@_);
}
sub _syntax_highlig
require Syntax::Highlight::RDF;
require Syntax::Highlight::XML;
require Syntax::Highlight::JSON2;
# Syntax::Highlight::RDF uses different CSS classes
my $css = $self->code_styles;
$sel
unless $css->{xml_tag_is_doctype};
$self->_pull_code_styles(%Syntax::Highlight::JSON2::STYLE)
unless $css->{json_boolean};
my $hlt = "Syntax::Highlight::RDF"->highlighter($opt->{language});
s::PinPayment;
use strict;
use warnings;
use Net::SSL;
use HTTP::Request;
use LWP::UserAgent;
use JSON;
our $VERSION = '0.04';
# build 4.1
sub new {
my ($class, %args) = (@_);
my $self = bless
rl);
$p->content_type('application/json');
$p->authorization_basic($api_key);
my $json_request = to_json( $self->{config}, {utf8 => 1} );
$p->content($json_request) unless $api eq 'refunds';
my $json_response;
if ($self->{response}->content) {
$json_response = from_json( $self->{response}->content, {utf8 => 1} );
$self->{json_response} = $json_response;
}
if ($json_res