bot::Scripts::eval;
{
$Hubot::Scripts::eval::VERSION = '0.1.0';
}
use strict;
use warnings;
use JSON::XS;
sub load {
my ( $class, $robot ) = @_;
$robot->hear(
qr/^eval:? on *$/i,
return if ( !$body || $hdr->{Status} !~ m/^2/ );
my $data = decode_json($body);
$msg->send( split /\n/,
$data->{stdout} || $d
return if ( !$body || $hdr->{Status} !~ m/^2/ );
my $data = decode_json($body);
$msg->send( split /\n/,
$data->{stdou
ON = '0.50';
use DateTime;
use Digest::MD5 qw(md5_hex);
use LWP::Simple;
use LWP::UserAgent;
use JSON;
use URI;
my %DEFAULTS = (
base_url =>
"http://sprintdevelopersandbox.com/developerSan
location => 'location.json',
presence => 'presence.json',
perimeter => 'geofence/checkPerimeter.json',
devices => 'devices.json',
device => 'device.json',
);
=head1 DESCRIPTIO
rl( url => $url, );
#warn "Response: $response\n";
my $output = $self->decode_response( json => $response, );
return $output;
}
=head2 build_url
Given a list of named arguments, const
JSON;
sub load {
my ( $class, $robot ) = @_;
$robot->httpd->reg_cb(
'/hubot/say' => sub {
my ( $httpd, $req ) = @_;
my $json = undef;
eval { $json
= decode_json( $req->{content} ); };
if ($@) {
$req->respond(
[
400,
'Bad Request',
{ content => 'text/json' },
"{ 'status': 'error', 'error': 'could not parse json' }"
]
);
return;
}
p}[$ii]->[UNKN_PDP_CNT]."\n";
}
}
return $out;
}
#sub xport {
# # TO DO, incl JSON format
# my ($self, $args_str) = @_; my $rrd=$self->{rrd};
#}
sub dump {
# XML dump of R
ecode_utf8/;
use JSON;
sub load {
my ( $class, $robot ) = @_;
$robot->httpd->reg_cb(
'/hubot/jira' => sub {
my ( $httpd, $req ) = @_;
my $json = undef;
uery_param("room");
$req_room=~s/^%23/#/;
}
eval { $json = decode_json( $req->{content} ); };
if ($@) {
$req->respond(
'Bad Request',
{ content => 'text/json' },
"{ 'status': 'error', 'error': 'could not parse json' }"
]
);
ror in the text, this method will return empty list), See SYNOPSIS. you can easily convert AoH to JSON or XML.
=head1 CAUTION
I'm afraid we don't have a good open source korean spell checker. but th
ME
Hubot::Scripts::Bundle - optional scripts for hubot
=head1 SYNOPSIS
example F<hubot-scripts.json>
[
"redisBrain",
"help",
"ping",
"uptime",
"whisper"
must be a B<Scalar> or B<HashRef> or B<ArrayRef>.
C<$robot-E<gt>brain-E<gt>data> will convert to json string and stored to external storage.
so, if you trying to store perl object, it will fail.
wit
qw(
.gitignore
Procfile
README.md
cpanfile
hubot-scripts.json
);
for my $file (@files) {
my ( $src, $dst )
= ( catfile("$dist_dir/
ay()
p to print()
dd to Data::Dump::dd()
jd to JSON::XS::encode (utf8/pretty)
jl to JSON::XS::decode (utf8/allow nonref) a thing
xd to XML::Hash::LX::hash
ift->done(1) }
sub TO_JSON {
my $self = shift;
return {
## prvent recursive call
## Hubot::UserTO_JSON -> Hubot::Message::TO_JSON -> Hubot::User::TO_JSON
user => {
sub match {
my ( $self, $regex ) = @_;
return $self->text =~ m/$regex/;
}
override 'TO_JSON' => sub {
my $self = shift;
return { %{ super() }, text => $self->text };
};
__PACKAGE__
my ( $class, $ref ) = @_;
$ref->{name} ||= $ref->{id};
bless $ref, $class;
}
sub TO_JSON { return { %{ shift() } } }
1;
=pod
=encoding utf-8
=head1 NAME
Hubot::User - storage object
googleImage;
{
$Hubot::Scripts::googleImage::VERSION = '0.1.0';
}
use strict;
use warnings;
use JSON::XS;
sub load {
my ( $class, $robot ) = @_;
$robot->respond(
qr/(image|img)( me)
uery($q)->get(
sub {
my ( $body, $hdr ) = @_;
my $images = decode_json($body);
$images = $images->{responseData}{results};
if (@$images) {
pts::githubIssue;
$Hubot::Scripts::githubIssue::VERSION = '0.1.10';
use strict;
use warnings;
use JSON;
sub load {
my $github = githubot->new;
my ( $class, $robot ) = @_;
$robot->hear(
return if ( !$body || $hdr->{Status} !~ /^2/ );
my $data = decode_json($body);
$issue_title = $data->{title};
my $base_url = $EN
{
Accept => 'application/vnd.github.'
. $self->{apiVersion} . '+json',
'User-Agent' => "p5-GitHubot"
}
);
my $oauth_token = $self->{token}
eLike::Base qw/ HashRef ArrayRef Str /;
use namespace::clean -except => 'meta';
use DateTime;
use JSON::Types;
use Message::Passing::Filter::Regexp::Log;
with qw/ Message::Passing::Role::Filter /;
us
output_to => 'decoder',
);
decoder decoder => (
class => 'JSON',
output_to => 'logstash',
);
filter logstash => (
class
]
output_to => 'encoder',
);
encoder("encoder",
class => 'JSON',
output_to => 'stdout',
output_to => 'es',
);
output std
o '["help"]' > hubot-scripts.json
$ hubot
hubot> hubot help
hubot> exit
=head1 DESCRIPTION
=head2 CONFIGURATION
describe scripts name to F<hubot-scripts.json>
example)
[
"he
se qw/ Str ArrayRef /;
use Scalar::Util qw/ weaken /;
use namespace::clean -except => 'meta';
use JSON;
use AnyMQ;
use AnyEvent;
use PocketIO;
use Twiggy::Server;
use Plack::Builder;
use Data::Section
age' => sub {
my $class = shift;
$class->send( to_json($self->_messages) );
$self->_clear_messages;
}
$server->register_service($app);
}
sub consume {
my ( $self, $msg ) = @_;
$msg = from_json($msg) unless ref($msg);
$self->anymq->publish({ msg => $msg });
}
# Preloaded methods go he
s::ClientJobs;
=head1 NAME
Qless::ClientJobs
=cut
use strict; use warnings;
use JSON::XS qw(decode_json encode_json);
use Qless::Job;
use Qless::RecurringJob;
use Qless::Utils qw(fix_empty_array);
of job objects that are being tracked
=cut
sub tracked {
my ($self) = @_;
my $results = decode_json($self->{'client'}->_track());
$results->{'jobs'} = fix_empty_array($results->{'jobs'});
$result
agged with a tag
=cut
sub tagged {
my ($self, $tag, $offset, $count) = @_;
my $results = decode_json($self->{'client'}->_tag([], 'get', $tag, $offset||0, $count||25));
$results->{'jobs'} = fix_empt
escription => 'API Authentication error, your request signature is invalid',
},
);
use JSON qw(decode_json);
use List::Util qw(first sum);
use LWP::UserAgent;
use Module::Load qw(load);
use Moo;
u
(is => 'rw'); # The HTTP Request (PSGI env) that is being evaluated
has '_json' => (is => 'rw'); # The raw json response from the server
has '_report_data' => (is => 'rw', def
;
}
my $request_path = @{$self->_search_capabilities} == 0
? '/v1/json/'
: '/v1/json/search:(' . join(',', @{$self->_search_capabilities}) . ')';
# Prepare reques
package Net::WURFL::ScientiaMobile::Cache::Cookie;
use Moo;
use JSON qw(decode_json encode_json);
use Plack::Request;
with 'Net::WURFL::ScientiaMobile::Cache';
has 'cookie_name' => (is => 'rw
return 0 unless $request->cookies->{$self->cookie_name};
my $cookiedata = eval { decode_json($request->cookies->{$self->cookie_name}) };
return 0 unless ref $cookiedata eq 'HASH';
re
abilities => $capabilities,
};
$self->cookies({
$self->cookie_name => encode_json($data),
});
}
sub setDeviceFromID { 1 }
sub getMtime { 0 }
sub setMtime { 1 }