RCBot;
use 5.010;
use strict;
use warnings;
our $VERSION = '0.01_01';
use AnyEvent::Redis;
use JSON;
=head1 NAME
ZenIRCBot - Perl API for ZenIRCBot
=head1 SYNOPSIS
use ZenIRCBot;
my $bot =
ent->subscribe('in', sub {
my ($raw, $channel) = @_;
my $json = JSON->new->allow_nonref;
my $msg = $json->decode($raw);
&{$func}($msg, $channel);
});
}
# Blocking
$to];
}
for my $channel (@{$to}) {
my $json = JSON->new->allow_nonref->allow_blessed->convert_blessed;
my $data = $json->encode({
version => 1,
type =>
reads JSON,
does no transformations on the deserialized data, and writes new JSON
one object per line.
package App::PipeFilter::JsonCat;
use Moose;
extends 'App::PipeFilter::Generic::Json';
package App::PipeFilter::JsonPcapToEthernet;
{
$App::PipeFilter::JsonPcapToEthernet::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic::Json';
with 'App::PipeFilter::Role::Transform
package App::PipeFilter::PcapToJson;
{
$App::PipeFilter::PcapToJson::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic';
with (
"App::PipeFilter::Role::Opener::PcapInput",
"App
::Role::Writer::Print",
"App::PipeFilter::Role::Input::ArrayBuffer",
"App::PipeFilter::Role::Transform::None",
"App::PipeFilter::Role::Output::Json",
);
1;
__END__
# vim: ts=2 sw=2 expandtab
END__
=pod
=abstract a generic pipeline filter.
=head1 SYNOPSIS
=for example App::PipeFilter::JsonToYaml
=head1 DESCRIPTION
App::PipeFilter::Generic is a generic shell pipeline filter. It is
de
For example, L<App::PipeFilter::JsonToYaml> extends the generic
pipeline filter with a role to read data in large chunks, a role to
parse that input as a stream of JSON objects, a role that doesn't
al
.
This method is usually implemented by Input roles.
=for example App::PipeFilter::Role::Input::Json decode_input
=head2 encode_output ARRAY
encode_output() accepts an array of Perl data structure
p::PipeFilter::JsonToTsv;
{
$App::PipeFilter::JsonToTsv::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic';
# TODO - Refactor into a common role? Duplicated in JsonCut.pm.
has o
e::Input::Json",
"App::PipeFilter::Role::Transform::None",
"App::PipeFilter::Role::Output::Tsv",
);
1;
__END__
=pod
=head1 NAME
App::PipeFilter::JsonToTsv - translate streams of JSON objects
is the json2tsv(1) pipeline filter.
#!/usr/bin/perl
use App::PipeFilter::JsonToTsv;
exit App::PipeFilter::JsonToTsv->new_with_options()->run();
=head1 DESCRIPTION
App::PipeFilter::JsonToTsv i
::JsonSort;
{
$App::PipeFilter::JsonSort::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::Sysread
App::PipeFilter::Role::Input::Json
App::PipeFilter::Role::Writer::Print
App::PipeFilter::Role::Transform::None
);
use JSON::XS;
has k => (
is => 'rw',
isa => 'ArrayRef',
default => sub { die "requ
("\t", @sortable{@fields}, encode_json($_)) . "\n";
} @_;
}
1;
__END__
=pod
=head1 NAME
App::PipeFilter::JsonSort - a sort(1)-like filter that understands JSON fields
=head1 VERSION
version 0
package App::PipeFilter::JsonCat;
{
$App::PipeFilter::JsonCat::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic::Json';
with 'App::PipeFilter::Role::Transform::None';
1;
__END__
peFilter::JsonCat - useless use of cat(1) for JSON streams
=head1 VERSION
version 0.005
=head1 SYNOPSIS
Here is the jcat(1) pipeline filter.
#!/usr/bin/perl
use App::PipeFilter::JsonCat;
ex
it App::PipeFilter::JsonCat->new_with_options()->run();
=head1 DESCRIPTION
App::PipeFilter::JsonCat implements the jcat(1) pipeline filter.
Please see jcat(1) for usage instructions.
This module su
=> $VERSION,
base => 'Scaffold::Handler',
constant => 'TRUE FALSE ARRAY',
codec => 'JSON',
;
# ----------------------------------------------------------------------
# Public Methods
#
---------------------------------------
sub do_api {
my ($self) = @_;
my $code;
my $json;
my $actions;
my $introspection = $self->introspect();
my $params = $self->scaffold->
ctions,
}
$json = encode($code);
if (($params->{format}) and ($params->{format} eq 'json')) {
$self->view->content_type('application/json');
$js = $json;
} else {
kage App::PipeFilter::JsonToTsv;
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::Sysread
App::PipeFilter::Role::Input::Json
App::PipeFilter:
age App::PipeFilter::JsonToYaml;
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::Sysread
App::PipeFilter::Role::Input::Json
App::PipeFilter:
Defaults to false, unless C<uuid.h> can be found and you have a compiler.
=item L<JSON::XS>
Provides faster JSON performance.
Defaults to true if you have a compiler.
=item L<YAML::XS>
Allows d
eTime;
use Scaffold::Class
version => $VERSION,
base => 'Scaffold::Handler',
codec => 'JSON',
;
# ----------------------------------------------------------------------
# Public Methods
#
;
$self->stash->view->template_disabled(1);
$self->stash->view->content_type('application/json');
}
# ----------------------------------------------------------------------
# Private Methods
};
__PACKAGE__->meta->make_immutable;
}
{
package Count;
use MooseX::Coro;
use JSON::Any qw(XS);
with qw(MooseX::Workers);
sub BUILD { POE::Kernel->run }
has sender =>
print JSON::Any->encode($count);
}
);
};
sub worker_stdout {
my ( $self, $out ) = @_;
warn $out;
my $count = JSON::Any->decode($out);
pp::PipeFilter::MysqlToJson;
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::LineByLine
App::PipeFilter::Role::Output::Json
App::PipeFilter::
onsible for knowing the conversion from in-memory
records to record stream wire format (currently JSON).
=head1 SYNOPSIS
use App::RecordStream::OutputStream;
my $string = App::RecordStream:
warnings;
use JSON;
my $json = JSON::XS->new();
$json->allow_nonref(1);
$json->allow_blessed(1);
$json->convert_blessed(1);
sub hashref_string {
my $record = shift;
return $json->encode($recor
wSocket;
use 5.006;
use Any::Moose;
=head1 NAME
AnyMQ::ZeroMQ - AnyMQ using just a socket and JSON.
=head1 VERSION
Version 0.01
=cut
our $VERSION = '0.02';
=head1 SYNOPSIS
my $bus = AnyMQ-
();
use File::Spec ();
use Scalar::Util ();
use Params::Util ();
use JSON::XS ();
use LWP::UserAgent ();
use HTTP::Cookies ();
use HTTP::Reques
rver found.';
my $response = $self->POST(
"$server/register",
'Content-Type' => 'application/json',
'Content' => $self->encode( \%params ),
);
if ( $response->code == 201 ) {
return 'A
server found.';
my $response = $self->PUT(
"$server/config",
'Content-Type' => 'application/json',
'Content' => $self->encode( \%copy ),
);
if ( $response->code == 204 ) {
return 'Con
$this) = @_;
return %$this;
}
sub as_hashref
{
my ($this) = @_;
return {%$this};
}
sub TO_JSON {
my ($this) = @_;
return $this->as_hashref();
}
sub has_key_spec {
my ($this, $spec) = @_
e preprocessed
java => 'text/x-java-source',
js => 'application/javascript',
json => 'application/json',
lsp => 'application/x-lisp',
lua => 'text/x-lua',
mak => 'text/x-makefil
=> 'JavaScript',
lexer => Wx::wxSTC_LEX_ESCRIPT, # CONFIRMED
},
'application/json' => {
name => 'JSON',
lexer => Wx::wxSTC_LEX_ESCRIPT, # CONFIRMED
},
'application/x-latex' => {