;
use File::Temp qw( tempdir );
use Path::Class qw( file );
use Silki::I18N qw( loc );
use Silki::JSON;
use Silki::Schema::Wiki;
use Silki::Types qw( Dir HashRef Tarball );
use Moose;
use MooseX::Sem
{
my $self = shift;
$self->_add_to_archive(
$self->_dir()->file('export-metadata.json'), {
silki_version => Silki->VERSION(),
export_format_version =>
e(
$self->_dir()->file('wiki.json'),
$self->_wiki()->serialize(),
);
$self->_add_to_archive(
$self->_dir()->file('permissions.json'),
$self->_wiki()->permissio
use File::Slurp qw( read_file );
use Path::Class qw( dir );
use Silki::I18N qw( loc );
use Silki::JSON;
use Silki::Schema::Domain;
use Silki::Schema::User;
use Silki::Schema::Wiki;
use Silki::Types qw
ki {
my $self = shift;
my $wiki_data = Silki::JSON->Decode(
scalar read_file(
$self->_find_file_in_archive('wiki.json')->stringify()
)
);
if ( Silki::Sche
ult_pages => 1,
);
my $perm_data = Silki::JSON->Decode(
scalar read_file(
$self->_find_file_in_archive('permissions.json')->stringify()
)
);
my %set = map
LF;
##################################################
use 5.006;
use strict;
use warnings;
use JSON::XS;
use IO::Compress::Gzip qw( gzip $GzipError );
use Log::Log4perl;
use base qw(Log::Log4perl:
"%F",
"line"=> "%L",
"_pid" => "%P",
};
# make a JSON string
my $conversion_pattern = encode_json($gelf_format);
$options->{ConversionPattern} = { value => $conve
ender
Wraps the Log::Log4perl::Layout::PatternLayout return value so we can
gzip the JSON string.
=cut
sub render {
my($self, $message, $category, $priority, $caller_level) = @_
iguration as JSON
my $cfg_json = to_json($toolbar_cfg);
# Do some replacements so that the JSON data can be made into a JS string
# wrapped in single quotes
$cfg_json =~ s!\\!\\\\
!gm;
$cfg_json =~ s!\n!\\\n!gm;
$cfg_json =~ s!'!\\'!gm;
$html =~ s/%DEBUGTOOLBAR_CFG%/$cfg_json/m;
my $uri_base = request->uri_base . $path_prefix;
$html =~ s/%BASE%/$uri_ba
';
my $rows_key = 'rows';
my $sidx_key = 'sidx';
my $sord_key = 'sord';
my $json_key = 'json_data';
if ($config) {
$page_key = $config->{page_key} || 'page';
$rows
sidx_key} || 'sidx';
$sord_key = $config->{sord_key} || 'sord';
$json_key = $config->{json_key} || 'json_data';
}
my $page = $c->request->param($page_key) || 0;
my
=> $rows,
});
}
$c->stash->{$json_key}{page} = $page;
$c->stash->{$json_key}{total} = $total_pages;
$c->stash->{$json_key}{records} = $records;
return $result_se
k/java/javaee/jsp/index.html
--type-add=jsp:ext:jsp,jspx,jspf,jhtm,jhtml
# JSON
# https://json.org/
--type-add=json:ext:json
# Kotlin
# https://kotlinlang.org/
--type-add=kotlin:ext:kt,kts
# Less
#
nt;
use DateTime::Format::DateParse;
use HTML::TokeParser::Simple;
use URI;
use Web::Scraper;
use JSON::XS;
use Text::CSV_PP;
use feature 'say';
sub new {
my $class = shift;
my $args = shift
Net::Ostrich::VERSION = '0.01';
}
use Moose;
# ABSTRACT: Perl interface to Ostrich
use JSON::XS qw(decode_json);
use LWP::UserAgent;
has 'client' => (
is => 'rw',
isa => 'LWP::UserAgent',
self->port . $self->path . 'gc.json');
unless($resp->is_success) {
die("Failed to connect to ostrich: ".$resp->status_line);
}
return decode_json($resp->decoded_content);
}
lf->port . $self->path . 'ping.json');
unless($resp->is_success) {
die("Failed to connect to ostrich: ".$resp->status_line);
}
return decode_json($resp->decoded_content);
}
ame;
use Geo::GDAL;
use Geo::OGC::Geometry;
use Geo::Vector::Feature;
use Geo::Vector::Layer;
use JSON::XS;
use Gtk2;
use vars qw( @ISA %RENDER_AS );
our $VERSION = '0.52';
require Exporter;
@ISA
}) {
open my $fh, "<$params{features}";
my @a = <$fh>;
close $fh;
my $coder = JSON::XS->new->ascii->pretty->allow_nonref;
my $object = $coder->decode("@a");
if ($object->
res}}) {
$self->feature(Geo::Vector::Feature->new(GeoJSON => $o));
}
} else {
$self->feature(Geo::Vector::Feature->new(GeoJSON => $object));
}
} else {
for my $f (@{$params{
UserAgent;
use JSON;
our $VERSION = '1.0.1';
our %API_URI = (
'score' => 'http://api.klout.com/1/klout.json',
'users_show' => 'http://api.klout.com/1/users/show.json',
'users_
.klout.com/1/users/topics.json',
'influenced_by' => 'http://api.klout.com/1/soi/influenced_by.json',
'influencer_of' => 'http://api.klout.com/1/soi/influencer_of.json',
);
sub new {
my ($
I
my $url = $API_URI{ $action };
my $key = $self->{'api_key'};
my $users = encode_json(\@users);
my $res = $self->{'ua'}->post($url, { 'key' => $key, 'users' => $users });
un
uniq );
use Path::Class qw( dir file );
use Silki::Config;
use Silki::I18N qw( loc );
use Silki::JSON;
use Silki::Schema;
use Silki::Schema::Account;
use Silki::Schema::Domain;
use Silki::Schema::Fil
ean;
use autodie;
use Carp qw( croak );
use Silki::Config;
use Silki::I18N qw( loc );
use Silki::JSON;
use Silki::Schema;
use Silki::Schema::File;
use Silki::Web::CSS;
use Silki::Web::Javascript;
us
shift;
my $entity = shift;
$c->response()->content_type('application/json');
$c->response()->body( Silki::JSON->Encode($entity) );
return 1;
}
my %MethodPermission = (
GET =>
'0.29';
}
use strict;
use warnings;
use namespace::autoclean;
use HTTP::Status qw( RC_OK );
use JSON::XS;
use Scalar::Util qw( blessed );
use Silki::Types qw( ErrorForSession URIStr HashRef Bool Str
not available yet?
#requires qw( redirect_and_detach session_object );
my $JSON = JSON::XS->new();
$JSON->pretty(1);
$JSON->utf8(1);
my %spec = (
uri => { isa => URIStr, coerce
hRef, optional => 1 },
force_json => { isa => Bool, default => 0 },
json_content_type => { isa => Str, default => 'application/json' },
);
sub redirect_with_error {
my
s qw( encode_entities );
use HTTP::Status qw( RC_NOT_FOUND RC_INTERNAL_SERVER_ERROR );
use Silki::JSON;
# I'd really rather _not_ copy this whole thing in here, but it's the
# only way to override ho
if $user->user_id();
}
$error{error} = $error . '';
$self->log()->error( Silki::JSON->Encode( \%error ) );
}
sub finalize_error {
my $self = shift;
my @errors = @{ $self->e
package LLEval;
use 5.008_001;
use Mouse;
use MouseX::StrictConstructor;
use JSON;
use Furl;
use URI::Escape qw(uri_escape_utf8);
our $VERSION = '0.01';
has api_host => (
is => 'ro',
i
ent => "LLEval-Client/$VERSION" ),
},
);
has _json => (
is => 'ro',
isa => 'Object',
default => sub {
return JSON->new->utf8->pretty;
},
);
sub call {
my(
f($res->code != 200) {
confess "API Error: ", $res->status_line;
}
return $self->_json->decode($res->content);
}
sub call_eval {
my($self, $source, $lang) = @_;
return $self->
my $result = call_api(
{
format => 'json',
method => $api_method,
params => $a
$api_call = call_api(
{
format => 'json',
method => $api_method,
post
use URI;
use URI::Escape;
use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Response;
use JSON;
use WWW::EchoNest;
our $VERSION = $WWW::EchoNest::VERSION;
use WWW::EchoNest::Config;
use WWW:
our @EXPORT = qw[ ];
our @EXPORT_OK = qw[ call_api codegen fix_keys user_agent json_rep md5 ];
our %EXPORT_TAGS =
(
all => [ @EXPORT_OK ],
);
}
use pa
#######################################
#
# Set up a JSON pretty-printer
#
sub json_rep {
my $json = JSON->new->utf8->pretty();
return $json->encode( $_[0] )
}
# Set up the HTTP User Agent
use JSON;
use overload
'""' => '_stringify',
'cmp' => '_compare',
'==' => '_compare',
;
# FUNCTIONS ############################################################
#
sub _json_rep {
JSON->new->utf8->pretty()->encode( $_[0] ) }
sub _stringify {
return _json_rep( $_[0]->list() );
}
sub _compare {
return $_[0]->_stringify() cmp $_[1]->_stringify();
}
##############
rch [<options>] <LDAP-URL>\n" .
" where <options> are:\n" .
" -f --format {dsml|html|json|ldif} output format\n" .
" -u --user <username> user name (DN) to logon to LDAP se
to logon to LDAP server\n"
if (!$result || scalar(@ARGV) != 1 || ($format && $format !~ /^(dsml|json|ldif|html)$/));
# create a user agent object
my $ua = LWP::UserAgent->new;
$ua->agent("LWPsearch
search using LWP mechanisms
=head1 SYNOPSIS
B<LWPsearch.pl>
[B<-f|--format> {C<dsml>|C<html>|C<json>|C<ldif>}]
[B<-u|--user> I<user>]
[B<-p|--password> I<password>]
B<LDAP-URL>
=head1 DESCRIPTION
$attr_name (@$attributes_ref) {
*{ $pkg . '::get_' . $attr_name } = sub {
use JSON;
my $self = $_[0];
my $args_ref = $_[1];