s.responders.without(responderToRemove);
},
dispatch: function(callback, request, transport, json) {
this.each(function(responder) {
if (responder[callback] && typeof responder[callback
= 'function') {
try {
responder[callback].apply(responder, [request, transport, json]);
} catch (e) {}
}
});
}
};
Object.extend(Ajax.Responders, Enumerable);
Aj
.transport.getResponseHeader(name);
} catch (e) {}
},
evalJSON: function() {
try {
return eval(this.header('X-JSON'));
} catch (e) {}
},
evalResponse: function() {
try
package Sledge::Plugin::JSONRPC;
use strict;
use warnings;
use JSON::Syck;
our $VERSION = '0.01';
sub import {
my $self = shift;
my $pkg = caller;
$pkg->register_hook(BEFORE_INIT => su
o strict 'refs';
*{"$pkg\::jsonrpc"} = \&_jsonrpc;
}
sub _jsonrpc {
my $self = shift;
my $req;
# Deserialize request
eval { $req = _deserialize_jsonrpc($self) };
if ($@ || !$
req) {
warn qq{Invalid JSONRPC request "$@"};
_serialize_jsonrpc($self,{
result => undef,
eror => 'Invalid request'
});
return 0;
}
m
EVDB::API->new(app_key => $app_key, flavor => 'yaml');
Valid flavors are C<rest>, C<yaml>, and C<json>.
=cut
sub new
{
my $thing = shift;
my $class = ref($thing) || $thing;
my %params = @_
}
}
};
MochiKit.Base.update(MochiKit.Async, {
evalJSONRequest: function (/* req */) {
/***
Evaluate a JSON (JavaScript Object Notation) XMLHttpRequest
@param re
ndXMLHttpRequest(req);
},
loadJSONDoc: function (url) {
/***
Do a simple XMLHttpRequest to a URL and get the response
as a JSON document.
@param url: The URL
the evaluated JSON response
***/
var self = MochiKit.Async;
var d = self.doSimpleXMLHttpRequest.apply(self, arguments);
d = d.addCallback(self.evalJSONRequest);
eturn o + "";
},
registerJSON: function (name, check, wrap, /* optional */override) {
/***
Register a JSON serialization function. JSON serialization
functio
ns should take one argument and return an object
suitable for JSON serialization:
- string
- number
- boolean
- undefined
- obj
- Array-like (length property that is a number)
- Objects with a "json" method will have this method called
- Any other object will be used as {key:valu
Crypt::DES_EDE3
Convert::ASN1
Convert::PEM
Data::Buffer
Crypt::DSA
Authen::TypeKey::Sign
Crypt::SSLeay
Authen::Bitcard
Sys::Syscall
Danga::Socket
JSON
=cut
# more untaint modules
#
1;
sion 0.0.1
=head1 SYNOPSIS
# Escape Unicode charactors like '\\u3042\\u3043\\u3044'.
# JSON thinks No more Garble!!
# case 1
use Unicode::Escape;
my $escaped1 = Unicode::Escape
ctions
use HTTP::Status;
use XML::Dumper;
XML::Dumper::dtd;
use JSON;
my %formats = (
xml => \&pl2xml,
json => sub { objToJson( $_[0], {pretty => 1, indent => 4} ) },
browser => \&browserpri
}
my %query = map { split /=/ } split /;/, lc $ENV{QUERY_STRING};
my $formatter = $formats{json};
$formatter = $formats{ $query{format} }
if (exists $query{format}
and exists
simply return any Perl data structure, which will be serialized into the requested format (XML or JSON or "browser prettyprint" format), or you can actually construct a page yourself, perhaps even usi
e warnings;
use strict;
use Kwiki::Plugin '-Base';
use mixin 'Kwiki::Installer';
use IO::All;
use JSON;
our $VERSION = '0.01';
const class_title => 'Table of Contents';
const class_id => 'toc';
const
'prototype');
$registry->add(prerequisite => 'scriptaculous');
$registry->add(prerequisite => 'json');
$registry->add(preload => 'toc');
$registry->add(action => 'save_toc');
}
sub save_toc {
C
l>'
: '';
qq{<li><a href="$link"$class>$text</a>$subtree</li>};
} defined $_[0] ?@{$_[0]}:@{jsonToObj($self->structure_file->slurp)}));
}
1; # End of Kwiki::TableOfContents
__DATA__
=head1 NAME
'edit:edit',
post => 'add_button'
);
$registry->add(hook => 'headers:value',
post => 'add_x_json_header'
);
}
sub background_save {
my $page = $self->hub->pages->current;
if( $page->modified
>metadata->edit_by || 'UnknownUser',
edittime => $page->edit_time,
);
$self->hub->headers->json(%info);
return $page->modified_time;
}
$page->content(CGI::param('content'));
$page->update-
add_x_json_header {
return defined $self->json
? ('-X_JSON', '('.$self->json.')', $_[-1]->returned)
: $_[-1]->returned;
}
{
no warnings 'redefine';
no strict 'refs';
use JSON;
my $_json;
*S
rt, json) {
this.each(function(responder) {
if (responder[callback] && typeof responder[callback] == 'function') {
try {
responder[callback].apply(responder, [request, transport, json]);
ansport.getResponseHeader(name);
} catch (e) {}
},
evalJSON: function() {
try {
return eval('(' + this.header('X-JSON') + ')');
} catch (e) {}
},
evalResponse: function() {
e) {
var event = Ajax.Request.Events[readyState];
var transport = this.transport, json = this.evalJSON();
if (event == 'Complete') {
try {
(this.options['on' + this.transport.statu
%d' })">
<h3>Upload Progress</h3>
<div id="progress"></div>
</body>
</html>
EOF
$TEMPLATES->{json} = <<'EOF';
{"size":%d,"received":%d}
EOF
$TEMPLATES->{text} = <<'EOF';
size: %d
received: %d
EO
ize>
<received>%d</received>
</upload>
EOF
$MIMES = {
'application/x-json' => sub { sprintf( $TEMPLATES->{json}, @_ ) },
'application/x-yaml' => sub { sprintf( $TEMPLATES->{yaml}, @
lain' => sub { sprintf( $TEMPLATES->{text}, @_ ) },
'text/x-json' => sub { sprintf( $TEMPLATES->{json}, @_ ) },
'text/x-yaml' => sub { sprintf( $TEMPLATES->{yaml
qw(WWW::Hatena::Scraper WWW::Hatena::WanWanWorld::position);
use Digest::MD5 qw(md5_base64);
use JSON;
use Location::GeoTool;
use Encode;
Encode::Alias::define_alias( qr/^euc$/i => '"euc-jp"' );
su
craper::_getset; }
sub charcode { &WWW::Hatena::Scraper::_getset; }
sub json {
my $self = shift;
$self->{'json'} ||= JSON->new(unmapping => 1, quotapos => 1 , barekey => 1,utf8 => $self->charc
}&maxY=${maxY}&_=";
my $json = $self->json->jsonToObj($self->get_content('http://world.hatelabo.jp/position',$content));
for my $dog (map { $json->{$_} } keys %$json) {
my $voice = $do
#define YAML_IS_JSON 1
#define JSON_IS_SINGLEQUOTE 1
#include "perl_syck.h"
MODULE = JSON::Syck PACKAGE = JSON::Syck
PROTOTYPES: DISABLE
SV *
Load (s)
char * s
SV *
Dump (sv)
SV * sv
_JSON
# define PACKAGE_NAME "JSON::Syck"
# define NULL_LITERAL "null"
# define NULL_LITERAL_LENGTH 4
# define SCALAR_NUMBER scalar_none
char json_quote_char = '"';
static enum scalar_style json_
quote_style = scalar_2quote;
# define SCALAR_STRING json_quote_style
# define SCALAR_QUOTED json_quote_style
# define SCALAR_UTF8 scalar_fold
# define SEQ_NONE seq_inline
# define MAP_NONE
(p, syck_seq_read(n, i) ));
}
sv = newRV_noinc((SV*)seq);
#ifndef YAML_IS_JSON
if (n->type_id) {
char *lang = strtok(n->type_id, "/:");
package Catalyst::Plugin::JSONRPC;
use strict;
our $VERSION = '0.01';
use JSON ();
sub json_rpc {
my $c = shift;
my $attrs = @_ > 1 ? {@_} : $_[0];
my $body = $c->req->body;
my
q = JSON::jsonToObj($content) };
if ($@ || !$req) {
$c->log->debug(qq/Invalid JSON-RPC request: "$@"/);
$c->res->content_type('text/javascript+json');
$c->res->body(JSON::o
bjToJson({
result => undef,
error => 'Invalid request',
}));
return 0;
}
my $res = 0;
my $method = $attrs->{method} || $req->{method};
if ($m
=cut
use 5.006;
use strict; use warnings;
use utf8;
use Carp qw(croak);
use Data::Dumper;
use JSON;
use File::Share ':all';
=encoding utf8
=head1 DESCRIPTION
Base font class to support font fam
#
# PRIVATE METHODS
sub _generate_char_width {
my ($self) = @_;
my $name = sprintf("%s.json", lc($self->{font_name}));
my $file = dist_file('PDF-Create', $name);
my $data = _load_da
d_data {
my ($file) = @_;
open(my $fh, $file);
local $/;
my $json = <$fh>;
my $data = from_json($json);
close($fh);
return $data;
}
sub _supported_characters {
retu
_INTERVAL 1186
#define PG_JSON 114
#define PG_JSONB 3802
#define PG_JSONPATH 4072
#define PG_LANGUAGE_HANDLER
_INTERVALARRAY 1187
#define PG_JSONARRAY 199
#define PG_JSONBARRAY 3807
#define PG_JSONPATHARRAY 4073
#define PG_LINE