se AC::MrGamoo::Debug;
use AC::Daemon;
use AC::Conf;
use AC::Misc;
use AC::MrGamoo::Protocol;
use JSON;
use Sys::Hostname;
use Socket;
require 'AC/protobuf/mrgamoo.pl';
require 'AC/protobuf/mrgamoo_s
ant_reply => 1,
},{
jobid => $me->{id},
options => to_json( $r->{config} ),
initres => to_json( $initres, {allow_nonref => 1} ),
jobsrc => $mr->src(),
c
ommunicate with the API and returns the results in the 3
possible formats (provided by Ipernity): JSON, XML, SOAP, XML-RPC
=head1 METHODS
=over 4
=item B<new>( configuration arguments )
The constr
y/application/my_application_local.{yml,yaml,cnf,conf,jsn,json,...} AND
path/to/my/application/my_application.{yml,yaml,cnf,conf,jsn,json,...}
... and load the found configuration information ap
::Request::History;
use WebService::VaultPress::Partner::Request::Usage;
use Moose;
use Carp;
use JSON;
use LWP;
use Moose::Util::TypeConstraints;
my $abs_int = subtype as 'Int', where { $_ >= 0 };
>_croak_on_http_error( $res );
my $json = decode_json( $res->content );
# The API tells us if the call failed.
die $json->{reason} unless $json->{status};
return WebService::Vau
new(
api_call => 'CreateGoldenTicket',
ticket => exists $json->{url} ? $json->{url} : "",
);
}
sub get_usage {
my ( $self, %request ) = @_;
my $req
ing json files
B<not implemented yet>
Ensure you have json files:
json/en.json
json/fr.json
json/ja.json
Then specify the C<json> option:
$hl = I18N::Handle->new( json => 'json' )
Twitpic;
use warnings;
use strict;
use utf8;
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON;
use Net::OAuth;
our $DYNAMIC_FILE_UPLOAD = 1;
=head1 NAME
Net::Twitpic - The great new Net::Tw
request_method => 'GET',
request_url => 'https://api.twitter.com/1/account/verify_credentials.json'
);
$oauth_sign->sign;
my %uploadparams = (
'key' => $self->{'twitpic_api'},
'message' =>
ps://api.twitter.com/1/account/verify_credentials.json',
'Content-Type' => 'form-data'
);
my $request = POST('http://api.twitpic.com/2/upload.json',\%uploadparams,%req_headers);
$self->{r} = $sel
::Apache::RewriteRules;
use 5.008001;
use strict;
use warnings;
use Carp qw(croak);
use JSON::XS qw(decode_json);
use Path::Class qw(dir file);
use File::Temp qw(tempfile);
use LWP::UserAgent;
use H
r = <<"EOS";
#!/usr/bin/env perl
use strict;
use warnings;
use JSON::XS;
print "Content-Type: application/json;\\n\\n";
print encode_json({
host => \$ENV{HTTP_HOST},
path
>header('Location') if $res->header('Location');
}
else {
$result = eval { decode_json($res->content) };
die $@ if $@;
$result->{code} = $code;
$result->{host}
ION = '0.01';
use WebService::8tracks::Session;
use WebService::8tracks::Response;
use JSON::XS qw(decode_json);
use URI::Escape qw(uri_escape uri_escape_utf8);
use HTTP::Request;
our @CARP_NOT = (
sub api_url {
my ($self, $path, $qparam) = @_;
my $url = "http://api.8tracks.com/$path.json";
if ($qparam) {
if (ref $qparam eq 'HASH' && scalar keys %$qparam) {
my
->password);
}
my $res = $self->user_agent->request($req);
my $api_response = decode_json $res->content;
return WebService::8tracks::Response->new($api_response);
}
=head1 METHODS
=
{
$ret ~= %s{'object'} ~ ".";
}
# Should use JSON to build arglist.
my $args = %s{'args'}.join(",");
$ret ~= %s{'ca
e constructor. This may be more useful where you want to use other serialization
systems (e.g. JSON, XML, etc) to store configuration, which can be manipulated into a HashRef to
be passed into th
self->{statements} }, { code => args };
return self;
},
'""' => \&as_string;
use JSON::Syck;
our $VERSION = '0.3.1';
use Sub::Exporter -setup => {
exports => ['js'],
groups
v)
}
return "{" . join (",", map { JSON::Syck::Dump($_) . ":" . $ret{$_} } sort keys %ret) . "}";
}
else {
return JSON::Syck::Dump($obj)
}
}
sub as_string {
my
given in
perl's native form, you don't need to use L<JSON> module to serialized
it first. (Unless, of course, that's your purpose: to get a JSON
string in JavaScript.)
=item var( $name, [ $value ]
mark> and gives you human-readable reports
as a reply rather than a raw hashref, it also supports JSON output if
you want to dump the report somewhere in a machine-readable format.
If you have no tem
NOPSIS
use WWW::Lovefilm::API;
use XML::Simple;
use Data::Dumper;
use URI::Escape;
use JSON;
my %auth = Your::Custom::getAuthFromCache();
my $lovefilm = WWW::Lovefilm::API->new({
$auth{access_secret},
user_id => $auth{user_id},
content_filter => sub { decode_json(shift) }, # optional
});
if( ! $auth{user_id} ){
my %data = $lovefilm->RequestToken();
ackage JavaScript::Writer::Var;
use strict;
use warnings;
our $VERSION = '0.0.2';
use self;
use JSON::Syck;
sub new {
my ($class, $ref, $params) = @_;
tie $$ref, $class, $$ref, $params;
~ (/^JavaScript::Writer/)) {
$v = self->{value}->as_string;
}
else {
$v = JSON::Syck::Dump( self->{value} );
}
$v =~ s/\.?;?$/;/;
my $s = self->{name} . " = $v" ;
le assignement, it'll be written
as a javascript assignment too. Only the value are dumped with
C<JSON::Syck>.
=back
=head1 AUTHOR
Kang-min Liu C<< <gugod@gugod.org> >>
=head1 LICENCE AND COPYRI
strict;
use 5.008_001;
our $VERSION = '0.05';
use AnyEvent;
use AnyEvent::HTTP;
use Encode;
use JSON;
use MIME::Base64;
use Scalar::Util;
use URI;
use URI::QueryParam;
sub new {
my($class, %arg
_poll->() unless $body;
my $res = eval { JSON::decode_json($body) } || do {
($args{on_error} || sub { die @_ })->("JSON parsing error: $@");
return;
ent::FriendFeed::Realtime is an AnyEvent consumer that subscribes
to FriendFeed Real-time API via JSON long-poll.
=head1 AUTHOR
Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt>
=head1 LICENSE
Th
package HTTP::AppServer::Plugin::JsonCrud;
# Plugin for HTTP::AppServer that provides CRUD methods for
# storing JSON documents in a DBI (relational) database.
# 2010 by Tom Kirchner
################
se DBI;
use JSON;
use HTTP::AppServer::Plugin;
use base qw(HTTP::AppServer::Plugin);
our $VERSION = '0.01';
# database connection settings
my $DBEngine = 'mysql';
my $DBName = 'jsondb';
my $DB
ot';
my $DBPassword = '';
my $DBHost = 'localhost';
# database settings
my $DBTablePrefix = 'jsondb_';
# UUID generator instance
my $UUIDGenerator = Data::UUID->new();
# called by the server wh
RUD server for JSON objects and plain files.
# 2010 by Tom Kirchner
#
# routes:
# POST /create = erzeugt neues JSON-Dokument, liefert UUId zurueck
# GET /read/<uuid> = liefert JSON-Dokument oder
Fehler zurueck
# POST /update/<uuid> = aendert JSON-Dokument (erzeugt neue Revision)
# GET /delete/<uuid> = loescht JSON-Dokument
# GET /file/<filename> = gibt Datei innerhalb Document-Root z
document root.
# 2010 by Tom Kirchner
use 5.010000;
use strict;
use warnings;
use IO::File;
use JSON;
use Path::Trim;
use HTTP::AppServer::Plugin;
use base qw(HTTP::AppServer::Plugin);
our $VERSION
ION = '0.01';
use WebService::8tracks::Session;
use WebService::8tracks::Response;
use JSON::XS qw(decode_json);
use URI::Escape qw(uri_escape uri_escape_utf8);
use HTTP::Request;
our @CARP_NOT = (
sub api_url {
my ($self, $path, $qparam) = @_;
my $url = "http://api.8tracks.com/$path.json";
if ($qparam) {
if (ref $qparam eq 'HASH' && scalar keys %$qparam) {
my
->password);
}
my $res = $self->user_agent->request($req);
my $api_response = decode_json $res->content;
return WebService::8tracks::Response->new($api_response);
}
=head1 METHODS
=
ostende', date => 'tomorrow afternoon'
# JSON station lookup of all stations matching qr/oost/
print irail station => qr/oost/, dataType => 'json'
# XML vehicle lookup
print irail ve
ta.
=head1 FEATURES
=head2 Multiple output formats
The returned results can be in either XML, JSON or YAML format. You can even
select between two flavours XML (xml, XML) to suit your taste. Ofcou