queue
our $VERSION = '1.6'; # VERSION
extends 'Log::Saftpresse::Input';
use Redis;
use JSON qw(decode_json);
has 'server' => ( is => 'ro', isa => 'Str',
default => '127.0.0.1:6379'
);
has 'sock'
it_all_responses;
foreach my $entry ( grep { defined $_ } @queue ) {
push( @events, decode_json($entry) );
}
return @events;
}
sub eof {
my $self = shift;
return 0; # queues dont have an
h/to/socket"
db = 0
queue = "logs"
</Input>
=head1 Format
Format is expected to be in JSON format.
Each event must be a hash.
=head1 AUTHOR
Markus Benning <ich@markusbenning.de>
=head1
tomatically supply this
access token on every request:
$ matrixtool client -u @me:example.com json /_matrix/client/r0/publicRooms
...
=head1 OPTIONS
The following additional options are recog
sub-commands are recognised
=head2 json
Perform a direct JSON request
$ matrixtool client json PATH [DATA]
See also L<App::MatrixTool::Command::client::json>.
=head2 login
Obtain a client au
{$_} for qw( server user_id user_id_parameter );
return $self->SUPER::run( @args );
}
sub do_json
{
my $self = shift;
my ( $method, $path, %opts ) = @_;
my $client = $self->http_client;
Struct::Dumb qw( readonly_struct );
use Protocol::Matrix::HTTP::Federation;
require JSON;
my $JSON_pretty = JSON->new->utf8(1)->pretty(1);
my $opt_parser = Getopt::Long::Parser->new(
config => [
encode => "raw", # client tokens are already base64 encoded
);
};
}
sub JSON_pretty { $JSON_pretty }
## Builtin commands
package
App::MatrixTool::Command::help;
use base qw( Ap
attermost APIs
=cut
use AnyEvent;
use AnyEvent::WebSocket::Client 0.37;
use Carp;
use Furl;
use JSON;
use Time::HiRes qw( time );
use Try::Tiny;
=head1 SYNOPSIS
use AnyEvent;
use AnyEvent:
}
}
sub _handle_incoming {
my ($self, $conn, $raw) = @_;
my $msg = try {
decode_json($raw->body);
}
catch {
my $message = $raw->body;
croak "unable to decode
$res = $furl->get($self->{'host'} . $path, $self->_headers);
my $data = try {
decode_json($res->content);
} catch {
my $status = $res->status;
my $message = $res->cont
s 'Log::Saftpresse::CountersOutput';
use Log::Saftpresse::Utils qw( adj_int_units get_smh);
use JSON;
use Time::Piece;
use Template;
use Template::Stash;
$Template::Stash::LIST_OPS->{ type } = sub
}
return( $self->{_tt} );
}
sub json {
my $self = shift;
if( ! defined $self->{_json} ) {
$self->{_json} = JSON->new->pretty->utf8;
}
return( $self->{_json} );
}
sub template_content {
my
le="width:100%;height:300px"></div>
<script>
$( document ).ready(function() {
var data = [% self.json.encode( series ) %];
var options = {
series: {
stack: 1,
lines: {
show: true,
},
-key => $SALT,
-cipher => 'Blowfish'
);
return $cipher->encrypt(to_json($session));
}
sub _password_hash {
my ($self, $key, $password) = @_;
utf8::encode($key)
-key => $SALT,
-cipher => 'Blowfish'
);
try {
$session = from_json($cipher->decrypt($session));
}
catch {
throw Exception::Authorization::BadSession
presse::Output';
use Log::Saftpresse::Log4perl;
use Time::Piece;
use Search::Elasticsearch;
use JSON;
use File::Slurp;
has 'nodes' => ( is => 'rw', isa => 'Str', default => 'localhost:9200' );
has
my $json_text;
if( defined $self->template_file ) {
$json_text = read_file( $self->template_file );
} else {
$json_text = read_file( \*DATA );
}
return( from_json( $json_te
);
our $VERSION = '0.08';
use MIME::Base64 qw( decode_base64 );
use Protocol::Matrix qw( verify_json_signature );
use constant DESCRIPTION => "Fetch a server's signing key via another server";
use
tary_v2
{
my $self = shift;
my ( $server_name, $via ) = @_;
$self->http_client->request_json(
method => "GET",
server => $via,
path => "/_matrix/key/v2/query/$server_name
);
next unless defined $signing_key;
my $verified = eval { verify_json_signature( $result,
public_key => $signing_key,
origin =>
);
our $VERSION = '0.08';
use MIME::Base64 qw( decode_base64 );
use Protocol::Matrix qw( verify_json_signature );
use Net::Async::HTTP;
Net::Async::HTTP->VERSION( '0.40' ); # ->request on_ready
us
$self = shift;
my ( $server_name ) = @_;
my $server_cert;
$self->http_client->request_json(
server => $server_name,
request => $self->federation->make_key_v1_request(
$self = shift;
my ( $server_name ) = @_;
my $server_cert;
$self->http_client->request_json(
server => $server_name,
request => $self->federation->make_key_v2_server_request(
(.*)$/ or
return Future->fail( "Cannot parse room alias" );
$self->http_client->request_json(
method => "GET",
server => $server,
path => "/_matrix/client/r0/directory/ro
enlists distribution files (including automatically
#pod generated files like F<Build.PL>, F<META.json>, F<META.yml>) and itself is a part of distribution.
#pod Distribution manifest may be a part of
fest enlists distribution files (including automatically
generated files like F<Build.PL>, F<META.json>, F<META.yml>) and itself is a part of distribution.
Distribution manifest may be a part of sourc
latitude longitude
my $json = $forecast->request(29.7492738082192, -95.4709680410959);
# Human readable summary of daily data
say $json->{daily}->{summary};
=head1 OVERVIEW
unters to stdout
our $VERSION = '1.6'; # VERSION
extends 'Log::Saftpresse::CountersOutput';
use JSON;
use Data::Dumper;
use Sys::Hostname;
has 'format' => ( is => 'rw', isa => 'Str', default => 'gr
eq 'graphit' ) {
$self->_output_graphit( \%data );
} elsif ( lc $self->format eq 'json' ) {
$self->_output_json( \%data );
} elsif ( lc $self->format eq 'perl' ) {
$self->_output_perl( \%data
) = @_;
print Dumper( $data );
return;
}
sub _output_json {
my ( $self, $data ) = @_;
my $json = JSON->new;
$json->pretty(1);
print $json->encode( $data );
return;
}
1;
__END__
=pod
=enc
::Request;
$WebService::ForecastIO::Request::VERSION = '0.02';
use Moo::Role;
use HTTP::Tiny;
use JSON;
# ABSTRACT: Request role for WebService::ForecaseIO
has 'base_url' => (
is => 'ro',
d
);
},
lazy => 1,
);
has 'decoder' => (
is => 'ro',
default => sub {
JSON->new();
},
lazy => 1,
);
sub request {
my $self = shift;
my $url = $self->base_
er agent for the role. Uses L<HTTP::Tiny>.
=head2 decoder
The library to deserialize JSON responses. Uses L<JSON>.
=head1 AUTHOR
Mark Allen <mrallen1@yahoo.com>
=head1 COPYRIGHT AND LICENSE
This
gin::Role::Tracking';
use Log::Saftpresse::Log4perl;
use JSON;
has 'json' => (
is => 'ro', isa => 'JSON', lazy => 1,
default => sub { JSON->new; },
);
has 'test_stats' => ( is => 'ro', isa => 'Bo
tash->{'message'} = $msg;
}
# if JSON logging is configured decode JSON
if( $stash->{'message'} =~ /^{/ ) {
my $json_data;
eval {
$json_data = $self->json->decode( $stash->{'message'} );
rn('error while parsing amavis JSON log message: '.$@);
return;
}
if( ref($json_data) ne 'HASH' ) {
return;
}
@$stash{keys %$json_data} = values %$json_data;
}
if( ! defined $sta
rs => {
module => 'Dump',
},
),
Output => ordered_hash_ref (
dump_json => {
module => 'JSON',
},
),
);
return \%defaults;
},
);
has 'config' => ( is => 'rw' );
su
word = <$stdin>; chomp $password; print "\n";
$stdin->setflag_echo( 1 );
}
$self->do_json( POST => "/_matrix/client/r0/login",
content => {
type => "m.login.password",
r more examples see the t/cases directory in the tarball, which contains
some sample VCARDs and JSON dumps of the hash representation.
BEGIN:VCARD
KEY;PKEY=PVALUE:VALUE
KEY2:VALUE2
END:VCAR
ge returns and line feeds to spaces before passing the
string to the parser.
Neither YAML nor JSON can be handled.
Internally, XML::Lenient uses lots of regexes (and other things as
well. I kn
presence.
# See also
# https://github.com/matrix-org/matrix-doc/issues/734
$self->do_json( GET => "/_matrix/client/r0/sync",
params => {
filter =>
'{"room":{' .