}
sub json_json2 {
<<'...';
[% INCLUDE "js/json-json2.js" %]
...
}
sub json_json2_internal {
<<'...';
;(function(){
var JSON;
[% INCLUDE "js/json2.js" %]
[% INCLUDE "js/json-json2-intern
al.js" %]
}());
...
}
sub json_yui {
<<'...';
[% INCLUDE "js/json-yui.js" %]
...
}
sub json2 {
<<'...';
[% INCLUDE "js/json2.js" %]
...
}
sub xhr_gregory {
<<'...';
[% INCLUDE "js/xhr-
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 (
x.get('url/data.json');
var elem = document.getElementById('some-div');
elem.innerHTML = Jemplate.process('my-template.html', data);
or:
var data = Ajax.get('url/data.json');
var ele
r simply:
Jemplate.process('my-template.html', 'url/data.json', '#some-div');
or, with jQuery.js:
jQuery.getJSON("url/data.json", function(data) {
Jemplate.process('my-template.html
g
the template code. Presto, we have full featured JavaScript
templating language!
Combined with JSON and xmlHttpRequest, Jemplate provides a really simple
and powerful way to do Ajax stuff.
=head1
Experimental support for MYMETA
if ( $ENV{X_MYMETA} ) {
if ( $ENV{X_MYMETA} eq 'JSON' ) {
$self->Meta->write_mymeta_json;
} else {
$self->Meta->write_mymeta_yaml;
}
}
return 1;
}
1;
package Net::AMQP::PP;
use strict;
use warnings;
use JSON ();
our $VERSION = '0.01';
my $data = JSON::from_json(
q[{"domain":{"delivery tag":{"type":"longlong"},"exchange name":{"type":"shortstr"},"
lt => 1,
'File::ShareDir' => '1.00',
);
features(
'JSON support', [
-default => 0,
'JSON' => '2.00',
'JSON::XS' => '2.00',
],
'YAML support', [
'YAML' => '
r an
L<Inline>-based module. This writes C<Makefile>, C<META.yml>, and
C<MYMETA.yml> (or C<MYMETA.json>) if you set an experimental
environmental variable C<X_MYMETA>.
=head2 WriteMakefile (L<Module:
mymeta_json (L<Module::Install::Metadata>)
write_mymeta_yaml;
write_mymeta_json;
B<write_mymeta_yaml> command and B<write_mymeta_json> command are to
write C<MYMETA.yml> and C<MYMETA.json> respe
I
package WWW::Mixcloud;
use Moose;
use namespace::autoclean;
use URI;
use LWP::UserAgent;
use JSON;
use DateTime::Format::Atom;
use Carp qw/ croak /;
use WWW::Mixcloud::Cloudcast;
use WWW::Mixclo
= $self->ua->get( $API_BASE . $uri->path );
if ( $res->is_success ) {
return decode_json $res->content;
}
else {
croak 'API error: ' . $res->content;
}
}
1;
__END__
croak "need a working directory";
}
}
sub get_source_image {
my($this)= shift;
my ($json_url) = @_;
my $EXIT_CODE = 1;
my $content = "";
my $browser = WWW::Mechanize->new(
=> 0,
timeout => 3,
autocheck => 0,
);
$browser->get( $json_url );
if ( $browser->success( ) ) {
$EXIT_CODE=0;
} else {
$EXIT_CODE=1;
}
$cont
qw(DUI.js
Stream.js
hippie.js
hippie.pipe.js
jquery.ev.js
json2.js)
}
1;
__END__
=head1 NAME
Web::Hippie::App::JSFiles - Serve javascript files for Web::Hip
::Candy -components => [
qw(
InflateColumn::DateTime
TimeStamp
Helper::Row::ToJSON
EncodedColumn
)
];
use Data::Dumper;
use Text::Password::Pronounceable;
resultset_cl
}
);
}
sub TO_JSON {
my $self = shift;
return {
created_at => $self->created_at . "",
updated_at => $self->updated_at . "",
entries => $self->entries_TO_JSON,
%{ $self->next
::method },
};
}
sub entries_TO_JSON {
my $self = shift;
my $entry_rs = $self->entries;
my @entry_collection;
push @entry_collection, {
entryid => $_->entryid,
title => $_->title,
on_error on_message trusted_origin );
use AnyEvent;
use AnyEvent::Handle;
use Plack::Request;
use JSON;
use HTTP::Date;
use Digest::MD5 qw(md5);
sub call {
my ($self, $env) = @_;
my (undef,
ndler) = @_;
my $req = Plack::Request->new($env);
$env->{'hippie.message'} =
JSON::from_json($req->parameters->mixed->{'message'}, { utf8 => 1 });
$env->{'PATH_INFO'} = '/message';
$frame->next_bytes) {
$env->{'hippie.message'} = eval { JSON::decode_json($message) };
if ($@) {
$writer = $responder->
([200,
[ 'Content-Type' => 'application/json',
'Cache-Control' => 'no-cache, must-revalidate',
'Pragma
ate::time2str(time())
]]);
$sub->poll_once(sub { $writer->write(JSON::encode_json(\@_));
$writer->close });
}
}
elsif ($en
at least 5.8
use 5.008;
use strict;
use warnings;
use Mac::AppleScript qw(RunAppleScript);
use JSON::XS;
use Encode qw(encode decode);
use Carp qw(croak);
use Mac::Safari::JavaScript::Exception;
ou return from your JavaScript will be encoded into JSON with
Safari's native C<JSON.stringify> function and decoded on the Perl side
using the JSON::XS module.
JavaScript data structures are mapped
d C<false> to C<undef>, JSON::XS::true
(which you can treat like the scalar C<1>) and JSON::XS::false (which you
can treat like the scalar C<0>) respectivly. Please see L<JSON::XS>
for more informati
'text/html' => [ 'View', 'HTML' ],
'application/json' => [ 'View', 'JSON' ],
'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Du
p::Admin;
{
$Hadoop::Admin::VERSION = '0.4';
}
use warnings;
use Moose;
use LWP::UserAgent;
use JSON -support_by_pp;
has 'namenode' => (
is => 'ro',
isa => 'Str',
reader => 'get_nameno
Value=();
use Data::Dumper;
foreach my $hostref ( @{$self->{'JobTrackerInfo_AliveNodesInfoJson'}} ) {
push @returnValue, $hostref->{'hostname'};
}
return @returnValue;
}
sub tasktrac
;
my @returnValue=();
foreach my $hostref ( @{$self->{'JobTrackerInfo_BlacklistedNodesInfoJson'}} ) {
push @returnValue, $hostref->{'hostname'};
}
return @returnValue;
}
sub tasktrac
package Net::OneTimeSecret;
our $VERSION = "0.04";
use common::sense;
use JSON;
use LWP::UserAgent;
use URI::Escape;
use Encode qw( encode_utf8 decode_utf8 );
my $_USER_AGENT = LWP::UserAgent->new
a );
return from_json( decode_utf8( $response->decoded_content ) );
}
sub _get {
my ($self, $url) = @_;
my $response = $_USER_AGENT->get( $url );
return from_json( $response->decoded_
ent
You call it with Perl data, and get back Perl data. No messing
with encoding or decoding of JSON.
=item * Unicode
Unicode, errrm, seems to work OK.
=back
=head1 DESCRIPTION
See https://one
sub send_msg {
my ($self, $msg) = @_;
my $json = JSON::encode_json($msg);
$self->writer->write( "Content-Type: application/json\n\n$json\n--" . $self->boundary. "\n" );
}
1;
__END__
=he
nginx.org> using PSGI.
=head2 Configuration
To configure a Catalyst app in NGINX Unit, upload a JSON configuration
snippet via Unit's config API, available at an IP socket or a Unix domain
socket (d
s://unit.nginx.org/installation/#installation-startup>):
# curl -X PUT --data-binary @config.json --unix-socket \
/path/to/control.unit.sock http://localhost/config
A minimal L<configurat
0.11';
}
use Grimlock::Schema::Candy -components => [
qw(
TimeStamp
Helper::Row::ToJSON
+DBICx::MaterializedPath
)
];
use HTML::Scrubber;
resultset_class 'Grimlock::Schema
ne->name;
return $date_time;
}
sub TO_JSON {
my $self = shift;
return {
reply_count => $self->reply_count,
children => $self->children_TO_JSON,
parent => $self->parent,
body
=> $self->body,
%{ $self->next::method },
}
}
sub children_TO_JSON {
my $self = shift;
my $children_rs = $self->children;
my @child_collection;
push @child_collection, {
entryid
ally for
display in the user's web browser (but can generate other types of
output such as PDF or JSON). The code in C<lib/MyApp/View> selects the
I<type> of view to use, with the actual rendering te
such as PDF documents, e-mails, spreadsheets,
or even "behind the scenes" formats such as XML and JSON.
=item * Controller
As suggested by its name, the controller takes user requests and routes
the