use WWW::Mechanize;
use HTML::TreeBuilder::XPath;
use HTML::Entities;
use JSON;
use DBI;
use Net::FTP;
$VERSION = '0.04' ;
my
sta => $strErro,
);
my $json = \%resposta;
my $json_text = to_json($json, { utf8 => 1 });
print $json_text;
exit;
}
sub erroFTP
{
tp => $ftperror,
);
my $json = \%resposta;
my $json_text = to_json($json, { utf8 => 1 });
return $json_text;
exit;
}
sub
package Net::Twitter::Stream;
use strict;
use warnings;
use IO::Socket;
use MIME::Base64;
use JSON;
use IO::Socket::SSL;
our $VERSION = '0.28';
1;
=head1 NAME
Using Twitter's streaming api.
=head1
2651' );
sub got_tweet {
my ( $tweet, $json ) = @_; # a hash containing the tweet
# and the original json
print "By: $tweet->{user}{screen_name}\n";
/filter.json api call can be use to track up to 200 keywords
and to follow 200 users.
HTTP Basic authentication is supported (no OAuth yet) so you will need
a twitter account to connect.
JSON format
(and lazily) attempt to log in to the API and get one.
Returns a perl hash representation of the JSON output for L<https://open.ge.tt/1/users/login>.
=back
=cut
around BUILDARGS => sub {
my $o
bson, 'BSON matches what we expected';
=head1 DESCRIPTION
BSON is a binary-encoded extension of JSON. Test::BSON makes it easy to
verify that you have built a valid BSON document and that it matche
lid_bson> is provided as an alternative to C<bson_ok> using the same
naming convention as L<Test::JSON> but is not exported by default.
=head2 bson_is
Test passes if the two BSON documents are valid
ame naming
convention as L<Test::JSON> but is not exported by default.
=head1 SEE ALSO
This module uses L<BSON> and L<Test::Differences>, and is based on
L<Test::JSON>. Learn more about BSON at L<h
hema );
=cut
sub load {
my $self = shift;
$self->{schema} = $_[0];
# TODO load from JSON, YAML, XML
# TODO validation
return $self;
}#sub
=item create
my $ddl = $db_schema
ort.pm> is
here:
package Airport;
use warnings;
use strict;
use LWP::Simple;
use JSON;
# preparing a closure in order not to fetch the same airport code again and again
my $alr
ame&fmt=json";
my $content = get ($url);
warn "Cannot get a response for '$url'\n"
unless defined $content;
my $json = JSON->new->allow_nonref;
my $data = $json->decod
d');
}
__PACKAGE__->config(
default => 'text/html',
map => {
'application/json' => [qw/ JSON /],
map { $_ => [qw/ View Default /] }
qw( text/css text/html text/pl
:Ref
Gitalist::URIStructure::Fragment::WithLog
/;
use File::Type::WebImages ();
use JSON::XS qw/encode_json/;
sub base : Chained('/fragment/repository/find') PathPart('') CaptureArgs(0) {}
sub
tash->{Commit}->sha1,
count => 1,
file => $c->stash->{filename},
);
my $json_obj = !$commit
? { }
: {
sha1 => $commi
};
$c->response->content_type('application/json');
# XXX Make use of the json branch
$c->response->body( encode_json $json_obj );
};
__PACKAGE__->meta->make_immutable;
ons for remote viewing
with 'MooseX::Getopt::Dashes';
use IO::Select;
use IO::Socket::INET;
use JSON;
use Scalar::Util 'weaken';
use Term::Filter::Callback;
use Term::ReadKey;
use Try::Tiny;
has
m_metadata_string {
my $self = shift;
my %data = @_;
my $json = JSON::encode_json(\%data);
return "\e[H\x00$json\xff\e[H\e[2J";
}
sub _build_socket {
my $self = shift;
my $
$ctx->req->uri->path("/legacy$path");
}
if($path =~ s/[.]json$// && $ctx->req->content_type eq 'application/json') {
$ctx->req->uri->path($path);
}
};
around uri_for => su
:Discogs;
use strict;
use warnings;
use LWP::UserAgent;
use URI;
use URI::Escape;
use Carp;
use JSON::XS;
use Data::Dumper;
use 5.008;
our $VERSION = '0.13';
our @namespaces = qw ( Artist Release
\$query_params,
);
my \$json = JSON::XS::decode_json( \$res->decoded_content );
my \$class_data = \$json->{resp}->{'$name'};
\$class_data->{_uri}
\$class_data->{_params} = \$query_params;
if (\$json->{resp}->{status} == JSON::XS::true &&
defined \$json->{resp}->{'$name'}) {
return $pkg->new(\%{\$cl
warnings;
use Carp;
our $VERSION = '0.04';
use utf8;
use LWP::UserAgent;
use HTTP::Request;
use JSON;
use URI;
our @namespaces = qw( Person Movie );
for (@namespaces) {
my $package = __PACKAGE_
eader( 'Accept' => 'application/json' );
my $json_response = $self->{ua}->request($request);
if ( $json_response->is_success ) {
return decode_json $json_response->content();
}
else {
croak
sprintf( "%s returned by %s", $json_response->status_line, $url );
}
}
# Checks items that will be sent to the API($input)
# $params - an array that identifies v
ple.com 105327 123.15.16.108 - apiuser@example.com [19/Dec/2009:03:12:07 +0000] "POST /api/status.json HTTP/1.1" 200 80516 "-" "-" "-"
The duration, IP, timestamp, method, HTTP version, response and
x 0
=item * user packet - apiuser@example.com assigned index 0
=item * url packet - /api/status.json assigned index 0
=item * timestamp packet - since a busy server is likely to have several reques
package WWW::Mailgun;
use strict;
use warnings;
use JSON;
use MIME::Base64;
require LWP::UserAgent;
BEGIN {
our $VERSION = 0.4;
}
sub new {
my ($class, $param) = @_;
my $Key = $param
tent_Type => 'multipart/form-data', Content => $msg);
_handle_response($r);
return from_json($r->decoded_content);
}
sub _get_route {
my ($self, $path) = @_;
if (ref $path eq 'ARRA
r = $self->{lc($method)}->($self,'unsubscribes',$data);
_handle_response($r);
return from_json($r->decoded_content);
}
sub complaints {
my ($self, $method, $data) = @_;
$method = $met
vailable in JSON, with the additional limitation that only simple keys
are supported.
As a result, all possible YAML Tiny documents should be able to be
transformed into an equivalent JSON document,
nd return data and code configured.
For example for : GET http://localhost/rewrite_fake_route/12.json
return code : 200
return body : {"id":12,"test":"get test"}
In configuation, if you put paramete
ke id : :id
* add possibility to request data store in a file like response_file: file/get_answer.json
=head1 INIT MODULE ROUTE
Each route configured in dancer plugin configuration are declare fakly
eq $req->{_route_pattern})
{
set serializer => uc($req_params{format}) || 'JSON';
my $response = plugin_setting->{$req->method()}->{$route}->{response};
P::UserAgent;
use JSON::Any;
# ABSTRACT: Module for YQL queries
# PODNAME: WWW::YQL
has 'ua' => (
is => 'rw',
isa => 'Object',
predicate => 'has_ua',
);
has 'json_parser' => (
isa => 'Object',
predicate => 'has_json_parser',
);
sub BUILD{
my $self=shift;
$self->ua(new LWP::UserAgent());
$self->json_parser(new JSON::Any)
}
sub query{
my $self=shif
I, {
'q' => $query,
'format' => 'json',
});
}else{
$URI->query_form( 'q' => $query );
$URI->query_param( 'format' => 'json' );
$req = HTTP::Request->new(GET => $URI);
$
S3::Client;
use DateTime;
use Try::Tiny;
use List::MoreUtils qw( uniq );
use CHI 0.50;
use JSON qw(decode_json);
sub _init {
my ( $self, $options ) = @_;
$self->{AWS_ACCESS_KEY_ID} = $option
WS_S3_TEMPLATE_CACHE_OPTIONS} && !$cache_opts ) {
try {
$cache_opts = decode_json( $ENV{TEMPLATE_CACHE_OPTIONS} );
}
catch {
$cache_opts = undef;
t variable TEMPLATE_CACHE_OPTIONS. If using the environment
variable, the values need to be L<JSON> encoded. Otherwise the value will be
an in memory store. The option send is the following:
json_json2 {
<<'...';
[% INCLUDE "js/json-json2.compact.js" %]
...
}
sub json_json2_internal {
<<'...';
;(function(){
var JSON;
[% INCLUDE "js/json2.compact.js" %]
[% INCLUDE "js/json-json
-internal.compact.js" %]
}());
...
}
sub json_yui {
<<'...';
[% INCLUDE "js/json-yui.compact.js" %]
...
}
sub json2 {
<<'...';
[% INCLUDE "js/json2.compact.js" %]
...
}
sub xhr_gregory {
METHODS
head2 kernel
head2 ajax_jquery
head2 ajax_xhr
head2 ajax_yui
head2 json_json2
head2 json_yui
head2 json2
head2 xhr_gregory
head2 xhr_ilinsky
head2 xxx
=head1 COPYRIGHT
Copyright (
xplanation)}};Jemplate.JSON={parse:function(decodeValue){throw ("This is a Jemplate.JSON.parse "+stubExplanation)},stringify:function(encodeValue){throw ("This is a Jemplate.JSON.stringify "+stubExpla
ction(){Jemplate.Ajax={get:function(A,B){jQuery.get(A,null,B)},processGet:function(A,B){jQuery.getJSON(A,null,B)},post:function(A,B,C){jQuery.post(A,B,C)}}}())
...
}
sub ajax_xhr {
<<'...';
(func
B.setRequestHeader("Accept","text/json; text/x-json; application/json");return this.request(B,null,C)},processGet:function(A,B){this.get(A,function(C){B(Jemplate.JSON.parse(C))})},post:function(A,C,D)