Devel::Symdump
Email::Date::Format
File::Listing
File::Type
GD::Graph
GD::SecurityImage
IO::Pty
JSON
JSON::PP
List::MoreUtils
List::Util
MIME::Types
MLDBM
Module::CoreList
Module::Load
NetAddr::IP
Pac
r;
use strict;
use AnyEvent;
use Carp ();
use Encode ();
use Any::Moose;
use MIME::Base64 ();
use JSON;
use Tatsumaki::Error;
has application => (is => 'rw', isa => 'Tatsumaki::Application');
has con
=> (is => 'rw', isa => 'Str', lazy => 1, lazy_build => 1);
has json => (is => 'rw', isa => 'JSON', lazy => 1, default => sub { JSON->new->utf8 });
has binary => (is => 'rw', isa => 'Bool');
ha
$_[0]) {
if ($self->mxhr) {
my $json = $self->json->encode($_[0]);
return "Content-Type: application/json\n\n$json\n--" . $self->mxhr_boundary. "\n";
} else {
k',
api => 'http://qik.com/api/oembed.json',
url => 'http://qik.com/*',
},
{
name => 'Vimeo',
api => 'http://vimeo.com/api/oembed.json',
url => 'http://(www.)vimeo.com/*',
api => 'http://www.hulu.com/api/oembed.json',
url => 'http://*hulu.com/watch/*',
},
{
name => 'PhotoBucket',
ordie.com/videos/*',
},
{
name => 'Pownce',
api => 'http://api.pownce.com/2.1/oembed.json',
url => 'http://*.pownce.com/*',
},
{
name => 'Poll Everywhere',
0.0.1"
rport: 12345
auto: true
The configuration file is in L<YAML|YAML> or L<JSON|JSON> format. It consists
of a hash containing the options described in the above code example. Onl
package Crashplan::Client::User;
use strict;
use warnings;
use JSON;
our $VERSION = '0.003_0';
=head1 NAME
Crashplan::Client::User - Object representation of Crashplan PROe server's entity
=head1
rent object
my @attributes = grep {!/^rest|rest_header$/} keys %$self;
my $body = encode_json( { map {$_ => $self->{$_}} @attributes} );
$self->{rest}->PUT($self->url."/".$self->id,$body
def,
);
has output_format => (
is => 'ro',
isa => Str,
default => 'json',
init_arg => undef,
);
has output_info => (
is => 'ro',
isa => Arr
e datatype to be returned, default is xml.
$api->type('xml');
$api->type('yaml');
$api->type('json');
=item Movie_browse( %data )
C<< <http://api.themoviedb.org/2.1/methods/Movie.browse> >>
The
# RFC 2045, RFC 2046
'js' => 'text/javascript', # RFC 4329
'json' => 'application/json', # RFC 4627
'pdf' => 'application/pdf', # RFC 3778
'png
~ m{^text/}
|| $self->worker->content_type
=~ m{^application/(atom|css|javascript|json|rss|xml)})
{
# text
$self->worker->response->decode;
print {$fh} $se
:
=over 4
=item * JSON
=item * XML
=item * YAML
=item * HTML
=back
=cut
sub format {
my $self = shift;
if (@_) {
my $new = shift;
if ( $new !~ /^JSON|XML|YAML|HTML$/ )
rp "Invalid format. Must be one of JSON, XML, YAML, or HTML.";
return;
}
$self->{format} = $new;
}
return $self->{format} || "JSON";
}
=item mime_type
This return
carp "format() needs to be set";
return;
}
return "application/json" if $self->format eq "JSON";
return "text/xml" if $self->format eq "XML";
return "application/
TH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* \file yajl_parse.h
* Interface to YAJL's JSON stream parsing facilities.
*/
#include <yajl_common.h>
#ifndef __YAJL_PARSE_H__
#define __YAJL
pedef struct yajl_handle_t * yajl_handle;
/** yajl is an event driven parser. this means as json elements are
* parsed, you are called back to do something with the data. The
* func
size_t numberLen);
/** strings are returned as pointers into the JSON text when,
* possible, as a result, they are _not_ null padded */
int (* yajl_st
ng.h>
#define NEED_newRV_noinc
#define NEED_sv_2pv_flags
#include "ppport.h"
typedef yajl_handle JSON__YAJL__Parser;
int DEBUG = 0;
void callback_call(SV* hashref, unsigned int index) {
HV* has
ose,
callback_array_open,
callback_array_close,
};
MODULE = JSON::YAJL::Parser PACKAGE = JSON::YAJL::Parser
JSON::YAJL::Parser new(package, unsigned int allowComments = 0, unsigned int
);
RETVAL = parser;
OUTPUT:
RETVAL
void parse(JSON::YAJL::Parser parser, SV* data)
CODE:
const char * jsonText;
unsigned int jsonTextLength;
yajl_status status;
unsigned char
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* \file yajl_gen.h
* Interface to YAJL's JSON generation facilities.
*/
#include <yajl_common.h>
#ifndef __YAJL_GEN_H__
#define __YAJL_GEN_H
ed while in an error
* state */
yajl_gen_in_error_state,
/** A complete JSON document has been generated */
yajl_gen_generation_complete,
/**
* Set a function and context argument that should be used to
* output generated json. the function should conform to the
* yajl_print_t prototype while the context argument
he following classes inherit directly from L<GX::Serializer>:
=over 4
=item * L<GX::Serializer::JSON>
=item * L<GX::Serializer::Storable>
=back
=head1 AUTHOR
JE<ouml>rg A. Uzarek E<lt>uzarek@run
stdlib.h>
#include <string.h>
#define NEED_newSVpvn_flags
#include "ppport.h"
typedef yajl_gen JSON__YAJL__Generator;
void croak_on_status(yajl_gen_status s) {
if (s == yajl_gen_status_ok) {
{
Perl_croak(aTHX_ "YAJL: Unknown status");
}
}
MODULE = JSON::YAJL::Generator PACKAGE = JSON::YAJL::Generator
JSON::YAJL::Generator new(package, unsigned int beautify = 0, const char *
RETVAL = g;
OUTPUT:
RETVAL
void integer(JSON::YAJL::Generator g, long int n)
CODE:
croak_on_status(yajl_gen_integer(g, n));
void double(JSON::YAJL::Generator g, double n)
CODE:
croak_
us API
package WWW::Delicious::Simple;
use strict;
use warnings;
use JSON;
my $API_BASE = 'http://feeds.delicious.com/v2/json/urlinfo/data?url=';
sub get_url_info {
my ( $class, $args ) = @_
= $ua->get( $API_BASE . $args->{url} );
if ( $response->is_success ) {
return decode_json $response->content;
}
else {
die $response->status_line;
}
}
1;
__END__
=p
portion, of the Delicious (V2) API.
Patches welcome to support more of the API.
Returns decoded json returned from the API.
Possibly very unstable; may have future backwards incompatible releases,
s, $entity, $type, $dt) = @_;
$entity->{rest_time} -= $dt;
#d# warn "ENTITIY MAT DONE: " . JSON->new->pretty->encode ($entity) . "\n";
return unless $entity->{rest_time} <= 0;
my $handl
pattern (@$POS, 0);
if ($a) {
ctr_log (devel => "construction pad pattern at @$POS: %s", JSON->new->encode ($a));
my $obj = $Games::Construder::Server::RES->get_object_by_pattern ($a);
tity->{fail_chance}) {
ctr_log (debug => "Jumper (failed) values: %s",
JSON->new->encode ($entity));
$pl->msg (1, "Jumper malfunction. Please retry.");
ave_config;
} elsif ($hdr->{cmd} eq 'transfer_end') {
$self->{front}->msg;
#print JSON->new->pretty->encode ($self->{front}->{res}->{resource});
$self->{res}->post_proc;
ct
=============================================================
; `npm` configuration - package.json generation
[JSAN::NPM]
main = lib/Task/Sample/Dist/Core
with the documentation after each release
L<Dist::Zilla::Plugin::JSAN::NPM> - generate `package.json` file for your distribution
L<Dist::Zilla::Plugin::JSAN::NPM::Publish> - publish your distributi
/$self->{name}.json";
return unless -e "$file";
if (open my $plf, "<", $file) {
binmode $plf, ":raw";
my $cont = do { local $/; <$plf> };
my $data = eval { JSON->new->relaxed-
elf) = @_;
my $cont = JSON->new->pretty->utf8->encode ($self->{data});
my $pld = $Games::Construder::Server::Resources::PLAYERDIR;
my $file = "$pld/$self->{name}.json";
if (open my $plf,
::RES->get_assignment_for_score ($self->{data}->{score});
#print "ASSIGNMENT BASE VALUES: " . JSON->new->pretty->encode ([
# $desc, $size, $material_map, $distance, $time, $score
#]) . "\n