w(
extractHelpCreo3
);
use POSIX;
use Tie::File;
use utf8;
use Term::ProgressBar;
use JSON::Parse 'parse_json';
use IO::HTML;
use HTML::TreeBuilder 5 -weak;
use File::Basename;
use CAD::Firemen;
us
$progress->minor(0);
my $i = 0;
my $json;
foreach my $line (@toc){
my $line = strip($line);
if($i != 0 && substr($line, 0, 1) ne ";"){
$json .= $line ."\n";
}
$i++;
$pr
gress->update($lines);
}
print "\n";
my $jsonContent = parse_json($json);
if(!$jsonContent || !exists($jsonContent->{"words"}) || !exists($jsonContent->{"pages"})){
return (0, "Could not
VERSION
version 0.01
=head1 SYNOPSIS
my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
$client->enable('Format::Text');
=head1 DESCRIPTION
Net::HTTP::Spore::Middleware::Format
element => './@element';
has_xpath_value profile => './@profile';
has_xpath_value json => './@json:serialize';
has_xpath_object_list param => (
'./wadl:param' => 'W3C::SOAP::WADL::Do
aits;
use W3C::SOAP::WADL::Meta::Method;
use MooseX::Types::Moose qw/Str Int HashRef/;
use JSON qw/decode_json/;
use W3C::SOAP::Utils qw/ns2module/;
use TryCatch;
Moose::Exporter->setup_import_method
PANTS.txt
Makefile
Makefile.old
MANIFEST.bak
META.json
META.yml
pm_to_blib
README
>,
],
);
$builder.cre
pace wadl => 'http://wadl.dev.java.net/2009/02';
add_xpath_namespace json => 'http://rest.domain.gdl.optus.com.au/rest/3/common-json';
has_xpath_value target_namespace => './@targetNamespace';
has_xp
It supports less
features (currently only supports sending/receiving Riap request and response in
JSON encoding, no encryption, no authentication, no sending of logging
messages). It is suitable for l
he following format:
"j" <JSON> <CRLF>
That is, the lowercase letter C<j> followed by JSON data (must all be in one
line), followed by CRLF.
=head2 Response
"j" <JSON> <CRLF>
That is, the lower
case letter C<j> followed by enveloped result encoded in JSON
(will all be in one line) and a single <CRLF>. The next request can then be sent
by client.
If client/server sends an invalid request/res
use Carp;
use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;
use TryCatch;
use JSON qw/decode_json/;
extends 'W3C::SOAP::Client';
our $VERSION = version->new('0.007');
has _response =>
t );
}
elsif ( $type eq 'application/json' ) {
# process JSON
$content = decode_json($content);
}
elsif ( $type eq 'text
e decided by the
implementation, but server MUST support C<json> as the fallback. If unspecified,
default in most cases should also be C<json>, but server can default to other
format, like say L<HTML>
rializations are supported, client can perform an C<srvinfo>
action.
Server should fallback to C<json> if requested result format is not supported.
=back
=head2 Additional actions
=head3 Action: B
l": "http://localhost:5000/",
// supported formats
"fmt": ["Console","HTML","JSON","PHPSerialization","YAML","json"],
}
=head2 Parsing Riap request from HTTP request
Server can provide default
rg_json => {
summary => 'Pass per_arg_json=1 to Perinci::Sub::GetArgs::Argv',
schema => 'bool',
},
per_arg_yaml => {
summary => 'Pass per_arg_json=1
meta=>$meta, meta_is_normalized=>1, common_opts=>$common_opts,
per_arg_json => $args{per_arg_json},
per_arg_yaml => $args{per_arg_yaml},
);
};
$gcd_res->[0]
Perinci::Sub::Complete;
my $compres;
last if $ospec->{is_json} || $ospec->{is_yaml} ||
$ospec->{is_base64};
#say "D
rotocol for requesting metadata and performing actions on code entities.
Examples are written in JSON (sometimes with added comments), but data
structures can actually be encoded using other formats.
1.2 (Oct 2014)
Version bumped to 1.2. This version addresses sending/receiving binary data over
JSON. In this version, client can send base64-encoded binary data in arguments
using C<ARGNAME:base64>
ase of L<Sub::Spec::HTTP::Server>.
=head1 SEE ALSO
L<Rinci>
JSON RPC, (version 1 at L<http://json-rpc.org>, version 2 at
L<http://jsonrpc.org>). First developed 2005, major revision to version 2 in
rl client to control the Browsermob Proxy server
use strict;
use warnings;
use Moo;
use Carp;
use JSON;
use LWP::UserAgent;
use IO::Socket::INET;
use Browsermob::Proxy;
has path => (
is => 'rw',
_addr . ':' . $self->server_port . '/proxy');
if ($res->is_success) {
my $list = from_json($res->decoded_content)->{proxyList};
my @proxies = map {
$_->{port};
If you use that on structured data (like a JSON structure), this might render your
data invalid. For instance if you have a large base64 string in your JSON, it will be broken
by this. To avoid this
Win32"){
use LWP::UserAgent;
use HTTP::Request;
use Time::Local;
use JSON qw(decode_json encode_json);
use MIME::Base64 (qw(encode_base64));
use Time::HiRes (qw/gettimeofday/);
} else {
use LWP::UserAgent;
use HTTP::Request;
use Time::Local;
use JSON qw(decode_json encode_json);
use MIME::Base64 (qw(encode_base64));
use Time::HiRes (qw/gettimeofday/);
ponse->content eq '') { # work around for JSON module which does not handle blank content well
return "";
} else {
return decode_json($response->content);
}
} else {
::CmdLine->new(url => '/MyApp/add_array')->run;
To execute the program:
% myapp --a1-json '[1,2,3]' --a2-json '[4,5,6]'
% myapp '[1,2,3]' '[4,5,6]'; # ditto
.------.
| 5 |
| 7 |
| 9 |
'------'
To output in other formats:
% myapp '[1,2,3]' '[4,5,6]' --format json
[200","OK",[5,7,9]]
% myapp '[1,2,3]' '[4,5,6]' --format=yaml
- 200
- OK
-
- 5
- 7
- 9
To
(using summary and
other information from metadata), output result in a variety of formats (YAML,
JSON, text, and more), among other things. Other features not demonstrated in
this tutorial include su
at is, the subsequent circular references will be deep-copied. This makes it
safe to transport to JSON, for example.
Sometimes it doesn't work, for example:
$data = [1];
push @$data, $data;
at is, the subsequent circular references will be deep-copied. This makes it
safe to transport to JSON, for example.
Sometimes it doesn't work, for example:
$data = [1];
push @$data, $data;
Cloni
SION = '0.0007';
use WebService::HipChat;
use Log::Dispatch::Output;
use Try::Tiny;
use JSON::XS qw/decode_json/;
use base qw( Log::Dispatch::Output );
use Params::Validate qw(validate SCALAR BOOL
my $response = HTTP::Response->parse( $http_response );
my $data = decode_json( $response->decoded_content );
if( $data->{error}{message} ){
die( sp
package Captcha::reCAPTCHA::V2;
use strict;
use warnings;
use Carp;
use HTTP::Tiny;
use JSON;
# ABSTRACT: A Perl implementation of reCAPTCHA API version 2
our $VERSION = '0.3'; # VERSION
sub new
ptcha_script {
my ($self, $sitekey, $options) = @_;
my $json_options = to_json({ sitekey => $sitekey, %$options }, $self->{json_options} || {});
return '<script type="text/javascript">va
r onloadCallback = function(){grecaptcha.render(\''
. _element_id($sitekey) . '\',' . $json_options . ');};</script>';
}
sub html {
my ($self, $sitekey, $options) = @_;
$options ||=
B<log_level> => I<any>
=item * B<pass_cmdline_object> => I<any> (default: 0)
=item * B<per_arg_json> => I<any>
=item * B<per_arg_yaml> => I<any>
=item * B<program_name> => I<any>
=item * B<read_
load
=head2 Using the server for completion
# foo-complete
#!perl
use HTTP::Tiny::UNIX;
use JSON;
my $hres = HTTP::Tiny::UNIX->new->post_form(
'http:/tmp/app1.sock//api/Perinci/CmdLine/Ser
NV{COMP_LINE},
point => $ENV{COMP_POINT},
'-riap-fmt' => 'json',
},
);
my $rres = decode_json($hres->{content});
print $rres->[2];
Activate bash tab completion:
% chmod