=> sub { $_[1] },
'-' => sub { return $_[2] ? $_[1] : 0 - $_[1] },
'*' => sub { 0 },
'/' => sub { 0 },
'fallback' => 1
;
sub TO_JSON { undef }
our $AUTOLOAD;
sub AUTOLOAD { shift }
1;
{
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/users/%s.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=item get_badges
my $res = $tp->us
y $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/users/%s/badges.json', @args;
$api->base->call("GET", $uri, @_);
}
sub badges {
my $self = shift;
Carp::
hift;
my @args;
push @args, shift; # id
my $uri = sprintf '/users/%s/badges/@learning.json', @args;
$api->base->call("GET", $uri, @_);
}
sub learning_badges {
my $self = shift;
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/events/%s.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=back
=cut
### END auto-generated
1;
ua::EN::NameParse->new;
Readonly my $DEFAULT => '';
Readonly my @META_FILES => ('META.yml','META.json');
Readonly my @LICENSE_FILES => ('LICENSE','COPYING','README');
Readonly my $DUMMY_COPYRIGHT =>
use base 'Bash::Completion::Plugin';
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use JSON;
use Bash::Completion::Utils qw( command_in_path );
sub should_activate {
my @commands = qw
= $ua->request(
POST 'http://api.metacpan.org/release/_search',
Content => encode_json(
{ size => 1000,
fields => ['distribution'],
sort
al {
my $json = decode_json( $res->content );
$req->candidates('') unless ( $json->{hits} );
my @candidates;
my $exact_match = 0;
for ( @{ $json->{hits}->{hits}
use base 'Bash::Completion::Plugin';
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use JSON;
use Bash::Completion::Utils qw( command_in_path );
sub should_activate {
my @commands = qw
= $ua->request(
POST 'http://api.metacpan.org/release/_search',
Content => encode_json(
{ size => 1000,
fields => ['distribution'],
sort
al {
my $json = decode_json( $res->content );
$req->candidates('') unless ( $json->{hits} );
my @candidates;
my $exact_match = 0;
for ( @{ $json->{hits}->{hits}
hine::DB::VERSION = '0.18';
}
use strict;
use warnings;
use Carp qw/croak confess/;
use DBI;
use JSON;
use constant QUEUE_PREFIX => 'jm:';
use constant RESPONSE_PREFIX => 'jmr:';
sub new {
my (
$args{schema} ||= 'jobmachine';
return bless \%args, $class;
}
sub json {
my ($self) = @_;
return $self->{json} ||= JSON->new->allow_nonref;
}
sub listen {
my ($self, %args) = @_;
my $queue
;
my $class = $self->fetch_class($queue);
$self->{current_table} = 'task';
my $frozen = $self->json->encode($data);
my $sql = qq{
INSERT INTO
"$self->{schema}".$self->{current_table}
(clas
e;
BEGIN { extends 'Catalyst::Controller' };
with 'CatalystX::Controller::ExtJS::Direct';
use JSON::XS;
sub add : Chained('/') : Path : CaptureArgs(1) {
my($self,$c, $arg) = @_;
$c->stash->
->body( $c->stash->{add} + $arg );
}
sub echo : Local : Direct : DirectArgs(1) {
my ($self, $c) = @_;
$c->res->content_type('application/json');
$c->res->body(encode_json($c->req->data));
}
> 'root/static/images',
image_chooser_url => '/static/images'
}
);
# use a JSON view
# output is available at /images
1;
Example at L<http://www.extjs.com/deploy/dev/
/chooser.html>.
=head1 DESCRIPTION
This module generates an object which can be serialized to a json string. The ImageChooser class of ExtJS expects
the data in this way.
You can even look in subdi
my @args;
push @args, shift; # id
my $uri = sprintf '/external-feed-subscriptions/%s.json', @args;
$api->base->call("DELETE", $uri, @_);
}
=pod
=item get
my $res = $tp->extern
my @args;
push @args, shift; # id
my $uri = sprintf '/external-feed-subscriptions/%s.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=item add_feeds
my $res = $tp->ext
rgs;
push @args, shift; # id
my $uri = sprintf '/external-feed-subscriptions/%s/add-feeds.json', @args;
$api->base->call("POST", $uri, @_);
}
=pod
=item get_feeds
my $res = $tp->ex
xt", autosave => 1);
# post request to login
my $link = $self->{_hostedurl}.'api/json/accounts/login/';
my $request = new HTTP::Request('POST',$link);
my $content = '
::Request;
use HTTP::Headers;
use HTTP::Request::Common;
use Digest::SHA 'hmac_sha1_base64';
use JSON;
our $VERSION = '0.9';
use constant DEBUG => $ENV{MONITIS_DEBUG} || 0;
require Carp;
our $TOK
$self->{ua} ||= LWP::UserAgent->new(agent => "perl-monitis-api/$VERSION");
$self->{json} ||= JSON->new;
bless $self, $class;
}
sub auth_token {
my ($self, $token, $expires) = @_;
w($self->api_url);
$uri->query_form(
action => 'authToken',
output => 'json',
version => $API_VERSION,
secretkey => $self->secret_key,
apikey =>
},
list => { Direct => undef, DirectArgs => 1 },
},
class => 'DBIC::User',
use_json_boolean => 1,
create_requires => [qw(email first last)],
return_object => 1,
);
before 'deseri
o, don't rely on the
# existence of these modules.
die "Please install JSON::XS" unless eval "require JSON::XS";
die "Please install Algorithm::Diff"
unless eval "require Algorithm:
r; my $el=$it->(); ) {
$#{$el}=nNOTE; # drop ID
$el->[nBLOCK]+=0; # convert to numbers because JSON::XS
$el->[nORDER]+=0; # shows 0 as 0 but '0' as "0"
push @my_stuff, $el if( (ref($key)
? $
r; my $el=$it->(); ) {
$#{$el}=nNOTE; # drop ID
$el->[nBLOCK]+=0; # convert to numbers because JSON::XS
$el->[nORDER]+=0; # shows 0 as 0 but '0' as "0"
push @other_stuff, $el if( (ref($key)
rict;
use warnings;
=head1 NAME
Persevere::Client::Class - The Class interface to Persevere the JSON Database
=cut
our $VERSION = '0.31';
use HTTP::Request::Common qw(GET HEAD POST PUT DELETE);
$newclass{extends} = \%extends;
if ($self->{uuid}){
$newclass{useUUIDs} = $self->{client}->{json}->true;
}
if (defined $self->{properties}){
$newclass{properties} = \%{$self->{properties}
elf->{client}->{debug}){
print "DEBUG (FUNCTION create): POST $classpath " . $self->{client}->{json}->encode(\%newclass) . "\n";
}
my $req = $self->{client}->req('POST', $classpath, undef, \%ne
en notes are not
copied.
=item B<diff( $other_provider, %options )>
If L<Algorithm::Diff> and L<JSON::XS> are installed this method computes
a difference between 2 providers. If C<key> or C<uri> are
am.
=back
=cut
sub search {
my $api = shift;
my @args;
my $uri = sprintf '/assets.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=item delete
my $res = $tp->assets
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/assets/%s.json', @args;
$api->base->call("DELETE", $uri, @_);
}
=pod
=item get
my $res = $tp->assets
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/assets/%s.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=item put
my $res = $tp->assets->p
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/favorites/%s.json', @args;
$api->base->call("DELETE", $uri, @_);
}
=pod
=item get
my $res = $tp->favori
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/favorites/%s.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=back
=cut
### END auto-generated
1;
PTION
This module implements a simple C<modperl> handler that exports our
provider parameters in JSON or YAML to the WEB, e.g.:
$ curl http://localhost/-/config?yaml
---
TranslationEvalCache:
nfig
Since C<Apache2::Translation> version 0.31 JSON is default.
C<Apache2::Translation::Admin> can decode both formats provided the
L<YAML> and L<JSON::XS> modules are installed.
This format can be
my $api = shift;
my @args;
push @args, shift; # id
my $uri = sprintf '/badges/%s.json', @args;
$api->base->call("GET", $uri, @_);
}
=pod
=back
=cut
### END auto-generated
1;