::Transport;
use Xmldoom::ORB::Transport::JSON;
use Xmldoom::ORB::Transport::XML;
use strict;
our $TRANSPORT_MAP = {
json => 'Xmldoom::ORB::Transport::JSON',
xml => 'Xmldoom::ORB::Transport::XML'
d xmlw3cdom.js into share/javascript";
}
my $definition_json = Xmldoom::ORB::Definition::generate($test::BookStore::Object::DATABASE, 'json');
# setup our dojo bootstrap
$self->{bootstrap_xmldoo
untimeEngine');
dojo.require('Xmldoom.Definition.JSONParser');
// Init namespace with our definition data
BookStore = {
'DEFINITION': $definition_json
};
// setup connection to ORB
BookStore.connec
mldoom.Connection('http://localhost:8888/xmldoom/', 'json');
// parse and init the database definition
BookStore.database = Xmldoom.Definition.JSONParser.parse( BookStore.DEFINITION );
BookStore.data
package Xmldoom::ORB::Definition;
use Xmldoom::ORB::Definition::JSON;
use strict;
use Data::Dumper;
sub generate_object_hash
{
my $object = shift;
my $data = {
attributes => [ ],
key_names
fault to XML, however, I haven't written that
# yet!
}
if ( $type eq 'json' )
{
return Xmldoom::ORB::Definition::JSON::generate($database);
}
else
{
die "Can't generate ORB definition for
0.02';
use Carp;
use Data::Visitor::Callback;
use HTTP::Request::Common;
use LWP::UserAgent;
use JSON::Syck;
use URI;
our $APIBase = "http://www.lingr.com/api";
# scraped from Lingr wiki page
our $
arp "Don't know method '$method'. Defaults to GET";
"GET";
};
$args->{format} = 'json';
my $req;
if ($req_method eq 'GET') {
$uri->query_form(%$args);
$req =
->is_success or croak "Request failed: " . $res->status_line;
local $JSON::Syck::ImplicitUnicode = 1;
my $data = JSON::Syck::Load($res->content);
$data->{status} eq 'ok' or croak "Respons
use strict;
our $VERSION = '0.04';
use Data::Visitor::Callback;
use HTTP::Request::Common;
use JSON::Syck;
use POE qw( Component::Client::HTTP );
use URI;
our $APIBase = "http://www.lingr.com/api"
return;
}
warn $response->content if $Debug;
local $JSON::Syck::ImplicitUnicode = 1;
my $data = JSON::Syck::Load($response->content);
unless ($data->{status} eq 'ok'){
arp "Don't know method '$method'. Defaults to GET";
"GET";
};
$args->{format} = 'json';
if ($method =~ /^room\./ && $heap->{ticket}) {
$args->{ticket} = $heap->{ticket};
e Peekshows API. This method simply
needs to return the name of the plugin format. ie: 'rest', 'json'
=item C<parse($content)>
The C<parse()> method is called upon completion of an API call and is
e Plagger::Plugin::Subscription::LivedoorReader;
use strict;
use base qw( Plagger::Plugin );
use JSON::Syck;
use URI;
use Plagger::Mechanize;
use Plagger::Util;
sub plugin_id {
my $self = shift;
return JSON::Syck::Load($self->{mech}->content);
}
return;
}
1;
__END__
=head1 NAME
Plagger::Plugin::Subscription::LivedoorReader - Synchronize livedoor Reader with JSON API
=head1
=head1 DESCRIPTION
This plugin allows you to synchronize your subscription using Livedoor
Reader JSON API.
=head1 CONFIGURATION
=over 4
=item username, password
Your username & password to use wi
= WebService::SimpleAPI::Wikipedia->new({ quiet => 1 });
my $json = $api->api({ keyword => 'Google', search => 1, output => 'json' });
=head1 DESCRIPTION
The content of Wikipedia concerning th
/../pugs -CPIL2-JSON -e ' say "hello" ' | ../../pugs pil2_tokenizer.pl
use v6-alpha;
# tokenizer
my $tokens =
m:g:perl5 {(\"(?:\\\\|\\"|.)*?\"|[\:\,\=\{\(\[\}\)\]]|\w+)};
# JSON parser
# outp
are C<Pugs>, C<PIR>, C<GHC>, C<JS>, and various variants of PIL:
C<PIL1>, C<PIL1-Binary>, C<PIL1-JSON>, C<PIL1-Perl5> (and C<PIL2-...>).
Note that, as with C<-c>, C<BEGIN {...}> and C<CHECK {...}> b
=pod
PIL2-JSON Forth-like code emitter
by fglock
../../pugs -CPIL2-JSON -e ' say "hello "; say 1 + 1 ' | \
../../pugs pil2_json_emit_forth.pl
#! /usr/bin/forth
: &*END ;
"hello " &say
arator
}
# -- Main program
# this is the same for all languages
push @*INC, './';
require 'pil2_json_emit.pm';
# slurp stdin - xinming++
my $pil2 = ** $*IN.slurp;
my @b = tokenize( $pil2 );
# say
d
PIL2-JSON generic code emitter
by fglock
This is a non-runnable module - use 'pil2_json_emit_<language>.pl' instead
../../pugs -CPIL2-JSON -e ' say "hello" ' | \
../../pugs pil2_json_emit_p
kenize ( $s ) {
$s ~~ m:g:perl5 {(\"(?:\\\\|\\"|.)*?\"|[\:\,\=\{\(\[\}\)\]]|\w+)}; #"
}
# JSON parser - creates an Array [of Array]* of Str
sub parse (@start, $token, @end, @_ is rw) {
st
=pod
PIL2-JSON simple Perl 6 code emitter
by fglock
../../pugs -CPIL2-JSON -e ' say "hello" ' | \
../../pugs pil2_json_emit_p6.pl
use v6-alpha;
&*END () { }
(&say("hello"));
Other exa
mples:
../../pugs -Cpil2-json -e ' my Int $x; ($x~"a")( "a",1,$x,$x+1); { say 1 } ' | \
../../pugs pil2_json_emit_p6.pl
The code created by this example has syntax errors, but I'm not sure if
ngs are
really forbidden in p6:
../../pugs -Cpil2-json -e 'my ($x,$y)=(1,2); sub infix:<aaa>($a,$b){$a+1} 1 aaa 2;' | \
../../pugs pil2_json_emit_p6.pl
=cut
use v6-alpha;
# -- Language speci
=pod
PIL2-JSON Parrot-like code emitter
by fglock
../../pugs -CPIL2-JSON -e ' say "hello "; say 1 + 1 ' | \
../../pugs pil2_json_emit_pir.pl
#! /usr/bin/parrot
... TODO
=cut
use v6-al
arator
}
# -- Main program
# this is the same for all languages
push @*INC, './';
require 'pil2_json_emit.pm';
# slurp stdin - xinming++
my $pil2 = ** $*IN.slurp;
my @b = tokenize( $pil2 );
# say
# PIL2-JSON simple tokenizer, parser, and code emitter
# ../../pugs -CPIL2-JSON -e ' say "hello" ' | ../../pugs pil2_json_emit.pl
use v6-alpha;
# tokenizer
my $tokens =
m:g:perl5 {(\"(?:\\\\|\\
"|.)*?\"|[\:\,\=\{\(\[\}\)\]]|\w+)};
# JSON parser
# outputs a p6 tree = Hash of Array|Hash|Scalar ...
sub parse (@start, $token, @end, @_ is rw) {
state %tok = (
token => sub (@_ is rw
le $module.Instances ()
where
import $module
import Data.Yaml.Syck
import DrIFT.YAML
import DrIFT.JSON
import DrIFT.Perl5
import DrIFT.Perl6Class
import Control.Monad
import qualified Data.ByteString
=pod
PIL2-JSON simple Perl 6 code emitter
by fglock
../../pugs -CPIL2-JSON -e ' say "hello" ' | \
../../pugs pil2_json_emit_p6.pl
use v6-alpha;
&*END () { }
(&say("hello"));
Other exa
mples:
../../pugs -Cpil2-json -e ' my Int $x; ($x~"a")( "a",1,$x,$x+1); { say 1 } ' | \
../../pugs pil2_json_emit_p6.pl
The code created by this example has syntax errors, but I'm not sure if
ngs are
really forbidden in p6:
../../pugs -Cpil2-json -e 'my ($x,$y)=(1,2); sub infix:<aaa>($a,$b){$a+1} 1 aaa 2;' | \
../../pugs pil2_json_emit_p6.pl
=cut
use v6-alpha;
# -- Language speci
=pod
PIL2-JSON Forth-like code emitter
by fglock
../../pugs -CPIL2-JSON -e ' say "hello "; say 1 + 1 ' | \
../../pugs pil2_json_emit_forth.pl
#! /usr/bin/forth
: &*END ;
"hello " &say
arator
}
# -- Main program
# this is the same for all languages
push @*INC, './';
require 'pil2_json_emit.pm';
# slurp stdin - xinming++
my $pil2 = ** $*IN.slurp;
my @b = tokenize( $pil2 );
# say
$res->is_error;
$note = $self->_parse($res->content);
1;
}
sub _parse {
my ($self, $json) = @_;
no warnings 'once';
local *F = sub {};
local *U = sub { $_[0] };
local *B
],
created_on => $_[5],
});
};
local *S = sub { $_[3] };
eval $json;
}
sub _uri_escape {
my $val = shift;
$val =~ s/\r?\n/<br>/g;
URI::Escape::uri_escap
e warnings;
use strict;
use Kwiki::Plugin '-Base';
use mixin 'Kwiki::Installer';
use IO::All;
use JSON;
use Data::Dumper;
our $VERSION = '0.02';
const class_title => 'Table of Contents Print';
const
=> $content,
);
}
sub print_pages {
my $page_name = CGI::param('page_name');
my $structure = jsonToObj(io->catfile($self->plugin_base_directory,
'toc', 'structure')->slurp);
return $page_name