use Data::GUID;
use DateTime;
use DateTime::Format::ISO8601;
use File::Slurp qw/write_file/;
use JSON;
use Metabase::Librarian 0.013; # bug fixes on extraction
use XML::Feed;
use namespace::autoclea
ersion = "1.0";
my $mb = $self->ct_metabase;
my $librarian = $mb->public_librarian;
my $json = JSON->new->pretty;
my $since = $self->since;
$since =~ s/Z?$/Z/;
my $guids = $librarian->se
ntry->title($msg);
$entry->author($fn);
$entry->summary($msg);
$entry->content($json->encode( $data ));
$entry->issued(DateTime::Format::ISO8601->parse_datetime( $ts ));
package App::Alice::Stream;
use JSON;
use Time::HiRes qw/time/;
use Try::Tiny;
use Any::Moose;
use strict;
use warnings;
has queue => (
is => 'rw',
isa => 'ArrayRef[HashRef]',
default => sub
started) {
$output .= "--".$self->seperator."\n";
$self->started(1);
}
$output .= to_json({
queue => $self->queue,
time => time - $self->offset,
}, {utf8 => 1});
$output .=
package App::Alice::MessageStore::Redis;
use Any::Moose;
use AnyEvent::Redis;
use JSON;
my $redis = AnyEvent::Redis->new;
has id => (
is => 'ro',
required => 1
);
has buffersize => (
is => '
ub add {
my ($self, $message) = @_;
return unless $message;
$redis->rpush($self->id, encode_json $message);
$redis->llen($self->id, sub {
$redis->lpop($self->id) if $_[0] > $self->buffersi
_[0] eq 'ARRAY' ? $_[0] : [];
$cb->(
grep {$_}
map {my $msg = eval {decode_json $_ }; $@ ? undef : $msg}
@$msgs
);
if ($end == $self->buffersize or @$msgs !=
se IRC::Formatting::HTML qw/html_to_irc/;
use App::Alice::Stream;
use App::Alice::Commands;
use JSON;
use Encode;
use utf8;
use Any::Moose;
use Try::Tiny;
has 'app' => (
is => 'ro',
isa => 'Ap
ender('range', $after, 'after');
my $res = $req->new_response(200);
$res->body(to_json [$before, $after]);
$respond->($res->finalize);
}
);
}
}
sub send_config {
f->app->render('server_listitem', $name);
my $res = $req->new_response(200);
$res->body(to_json({config => $config, listitem => $listitem}));
$res->header("Cache-control" => "no-cache");
re
t;
use HTML::Entities::Interpolate; # For %Entitize.
use HTML::Template;
use IPC::Capture;
use JSON::XS;
use Path::Class; # For dir() and cleanup().
our $VERSION = '1.03';
# --------------------
quotes to satisfy Path::Class.
# Encode HTML entities with HTML::Entities::Interpolate.
return JSON::XS -> new() -> encode
({
response =>
{
left => "$left_name",
message => $mess
AnyEvent::Util();
use Carp;
use ControlFreak::Util;
use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use JSON::XS;
use Object::Tiny qw{ name cmd pid is_running env auto };
use Params::Util qw{ _ARRAY _STRING
svc->tie_stdin_to,
no_new_session => $svc->no_new_session,
};
my $string = encode_json($descr);
$hdl->push_write("$string\n");
}
sub stop_service {
my $proxy = shift;
my %
escr = {
command => 'stop',
name => $svc->name,
};
my $string = encode_json($descr);
$hdl->push_write("$string\n");
}
sub unset {
my $proxy = shift;
my $attr =
with other Event loops.
=item * Log4perl
This is the logging backend of ControlFreak.
=item * JSON::XS
=item * Object::Tiny
=item * Try::Tiny
=item * Params::Util
=back
=head2 cpanm
Other in
package ControlFreak::Proxy::Process;
use strict;
use warnings;
use JSON::XS;
use Try::Tiny;
use POSIX 'SIGTERM';
use IO::Select;
$SIG{PIPE} = 'IGNORE';
=head1 NAME
ControlFreak::Proxy::Process -
s_command {
my $proxy = shift;
my $command = shift;
my $param = try {
decode_json($command)
} catch {
$proxy->log('err', "parse error in command $command: $_");
me, $pid, $es) = @_;
my $fh = $proxy->{status_fh}
or return;
my $string = encode_json({
status => $cmd,
name => $name,
pid => $pid,
exit_status => $es,
vent::Util();
use AnyEvent::Handle();
use Carp;
use ControlFreak::Util();
use Data::Dumper();
use JSON::XS;
use Params::Util qw{ _NUMBER _STRING _IDENTIFIER _ARRAY _POSINT };
use POSIX qw{ SIGTERM SIG
lue =~ /^\[/) {
$value = try { decode_json($value) }
catch {
my $error = $_;
$svc->{ctrl}->log->error("Invalid JSON: $error");
return;
};
me . $vp . $qs);
confess("Connection error: $res->{msg}") unless $res->{success};
return $res->{json};
}
1;
=pod
=head1 NAME
CouchDB::Client::DesignDoc - CouchDB::Client design documents (views)
package CouchDB::Client;
use strict;
use warnings;
our $VERSION = '0.09';
use JSON::Any qw(XS JSON DWIW);
use LWP::UserAgent qw();
use HTTP::Request qw();
use Encode qw(encode);
host} || 'localhost') . ':' .
($opt{port} || '5984') . '/';
}
$self{json} = ($opt{json} || JSON::Any->new(utf8 => 1, allow_blessed => 1));
$self{ua} = ($opt{ua} || LWP::UserAge
@;
return 1;
}
sub serverInfo {
my $self = shift;
my $res = $self->req('GET');
return $res->{json} if $res->{success};
confess("Connection error: $res->{msg}");
}
sub newDB {
my $self = shift;
::Functions qw(catdir catfile);
use File::Basename qw(dirname);
use Path::Class;
use Config;
use JSON;
__PACKAGE__->add_property('task_name' => 'Core');
__PACKAGE__->add_property('static_dir' => 's
om most outer {} brackets
$components =~ m/(\{.*\})/s;
$components = $1;
my $deploys = decode_json $components;
$self->concatenate_for_task($deploys, $self->task_name);
}
#===================
>make_tarball($dist_dir);
$self->delete_filetree($dist_dir);
$self->add_to_cleanup('META.json');
# $self->add_to_cleanup('*.gz');
}
#====================================================
bInfo {
my $self = shift;
my $res = $self->{client}->req('GET', $self->uriName);
return $res->{json} if $res->{success};
confess("Connection error: $res->{msg}");
}
sub create {
my $self = shift
y $res = $self->{client}->req('PUT', $self->uriName);
return $self if $res->{success} and $res->{json}->{ok};
confess("Database '$self->{name}' exists: $res->{msg}") if $res->{status} == 409;
confe
my $res = $self->{client}->req('DELETE', $self->uriName);
return 1 if $res->{success} and $res->{json}->{ok};
confess("Database '$self->{name}' not found: $res->{msg}") if $res->{status} == 404;
co
ML::Simple;
use JSON;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(getSWIFT new);
our $VERSION = '0.04';
my $format; #response return format i.e. xml json csv
my $swiftbi
}
}
sub validateFormat{
#Validate response format must match json, xml, or, csv
if ($format !~ /^json$|^xml$|^csv$/){
$error .= "INVALID - Result Format";
ess4></address4><location></location><country></country></swiftbic>";
}elsif($format eq "json"){
$responseString = "{\"result\":\"" . $responseString . "\",\"bic\":\"\",\"name1\":\
on
process could find it (C</usr/local/etc/genreport/daily.yml> or
C</opt/p5-genreport/etc/weekly.json>).
Use C<< genreport commands >> to figure out, which reports can be run.
=head1 FUNCTIONS/METH
::Simple;
use JSON;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(ibanValidate new);
our $VERSION = '0.05';
my $format; #response return format i.e. xml json csv
my $iban;
}
}
sub validateFormat{
#Validate response format must match json, xml, or, csv
if ($format !~ /^json$|^xml$|^csv$/){
$error .= "INVALID - Result Format";
ng=\"UTF-8\"?><iban><result>" . $responseString . "</result></iban>";
}elsif($format eq "json"){
$responseString = "{\"result\":\"" . $responseString . "\"}";
}
}
1;
ss("Storage error: $res->{msg}") unless $res->{success};
$self->{rev} = $res->{json}->{rev};
$self->{id} = $res->{json}->{id} unless $self->{id};
return $self;
}
sub contentForSubmit {
my $self =
tus} == 404;
confess("Connection error: $res->{msg}") unless $res->{success};
my $data = $res->{json};
my %private;
my @keys = keys %$data; # need to two-step this due to delete()
for my $k (@key
tus} == 404;
confess("Connection error: $res->{msg}") unless $res->{success};
my $data = $res->{json};
my %private;
my @keys = keys %$data; # need to two-step this due to delete()
for my $k (@key
error
use Moose;
use JSON;
use Moose::Util::TypeConstraints;
use overload '""' => \&error;
subtype error => as 'Str';
coerce error => from 'HashRef' => via { JSON::encode_json $_};
has http_error
::HTTP::API;
# we declare an API, the base_url is http://exemple.com/api
# the format is json and it will be append to the query
# You can set api_base_url later, calling $obj->api_base_u
lare my_api => (
api_base_url => 'http://exemple.com/api',
api_format => 'json',
api_format_mode => 'append',
);
# declaring a users method
# calling $obj-
net_api_declare backtype => (
base_url => 'http://api....',
format => 'json',
format_mode => 'append',
);
=over 2
=item B<api_base_url>
The base url for all t
oose::Role;
use Moose::Util::TypeConstraints;
sub content_type {
{ json => {value => 'application/json', module => 'JSON',},
yaml => {value => 'text/x-yaml', module => 'YAML'},