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
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
se strict;
use warnings;
use URI;
use URI::QueryParam;
use HTTP::Request;
use LWP::UserAgent;
use JSON::XS;
use Encode 'decode';
sub load {
my ( $class, $robot ) = @_;
$robot->hear(
q
$ENV{HUBOT_BITLY_API_KEY},
longUrl => $bitly,
format => 'json'
);
my $ua = LWP::UserAgent->new;
my $req = HTTP
>request($req);
return unless $res->is_success;
my $data = decode_json( $res->content );
$bitly = $data->{data}{url};
}
$msg->h
package Catalyst::TraitFor::Controller::jQuery::jqGrid::Search;
use 5.008;
use Moose::Role;
use JSON;
our $VERSION = '0.02';
my %qOp = (
'eq' => { pre => '', post => '', op => '=', },
{} unless $params->{_search} eq 'true';
if ( $params->{filters} ) {
return _complex_search( JSON->new->decode( $params->{filters} ) );
}
elsif ( $params->{searchField} ) {
# Simple sear
used to page
through data obtained from a back-end database. Ajax calls to the back-end
retrieve JSON data. See L<http://www.trirand.com/blog/>
This module provides a helper function to translate th
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}
ME
Hubot::Scripts::Bundle - optional scripts for hubot
=head1 SYNOPSIS
example F<hubot-scripts.json>
[
"redisBrain",
"help",
"ping",
"uptime",
"whisper"
t::Scripts::tweet;
{
$Hubot::Scripts::tweet::VERSION = '0.1.3';
}
use strict;
use warnings;
use JSON::XS;
sub load {
my ( $class, $robot ) = @_;
$robot->hear(
qr/https?:\/\/(mobile\
ps://api.twitter.com/1/statuses/show/'
. $msg->match->[1]
. '.json' )->get(
sub {
my ( $body, $hdr ) = @_;
r
^2/ );
print "$body\n" if $ENV{DEBUG};
my $tweet = decode_json($body);
$msg->send("$tweet->{user}{screen_name}: $tweet->{text}");
extends 'Hubot::Adapter';
use AnyEvent;
use AnyEvent::HTTP;
use AnyEvent::Campfire::Client;
use JSON::XS;
use Encode 'encode_utf8';
use HTTP::Request;
use LWP::UserAgent;
use Try::Tiny;
use Hubot::
),
);
$req->header( 'Accept', 'application/json' );
$req->header( 'Authorization', $bot->authorization );
my $res
cess;
my $userData;
try {
$userData = decode_json( $res->content );
}
catch {
$bot->emit( 'erro
# [ { name => 'foo', href => 'bar' }, ]
$c->render_json( $results );
} => "$object/autocomplete");
}
}
package WWW::Mailchimp;
use Moo;
use LWP;
use JSON;
use URI;
use PHP::HTTPBuildQuery qw(http_build_query);
use MooX::Types::MooseLike::Base qw(Int InstanceOf Num Str);
use Sub::Name;
our $VERSION = '
himp->new(apikey => $apikey);
# defaults ( datacenter => 'us1', timeout => 5, output_format => 'json', api_version => 1.3 )
my $campaigns = $mailchimp->campaigns;
my $lists = $mailchimp->lists;
on by default. This is also uri_escaped
=head1 BUGS
Currently, this module is hardcoded to JSON::from_json the result of the LWP request.
This should be changed to be dependent on the output_format.
ge namespace.
For example, Pipeline refers to Data::Pipeline::Pipeline while
JSON refers to Data::Pipeline::Adapter::JSON.
=head2 Aggregators
Aggregators allow multiple actions to be strung togethe
cover -report phabricator
=head1 DESCRIPTION
By default, this module generates a C<phabricator.json> file in
L<Devel::Cover>'s output directory. This file can then be parsed and used to
provide cov
upported by this report are:
=over
=item outputfile
The file to write the JSON report to. Defaults to I<phabricator.json> in the report directory.
=back
=head1 SEE ALSO
L<Devel::Cover>
L<Devel:
;
use 5.006;
our $VERSION = '0.01';
use Getopt::Long;
use File::Slurp qw(write_file);
use JSON qw(to_json);
use List::MoreUtils qw(any);
sub get_options {
my ($self, $opt) = @_;
$opt->{option} |
SCRIPTION
L<Pushwoosh|http://www.pushwoosh.com/> is a push notification service which
provides a JSON API for users of its premium account. This module provides a
simple Perl wrapper around that API.
the possible error codes.
=back
=cut
our $VERSION = '0.02';
use Carp;
use Furl;
use JSON qw(from_json to_json);
use Params::Validate qw(validate validate_with validate_pos :types);
use Try::Tiny;
@_,
{ app_code => 1,
api_token => 1,
api_url => { default => 'https://cp.pushwoosh.com/json/1.3' },
furl => 0,
error_mode => { default => 'croak' },
}
);
$args{furl} ||= Furl
();
use constant NAME => 'OMDB';
use constant PLOT => 'short';
use constant RESPONSE => 'json';
sub new {
my $class = shift;
my $args = shift;
my $self = $class->SUPER::new($ar
' --file 't/01-works.t' --count 3 --format JSON
=head1 TODO
needs docs
=cut
die qx{perldoc $0} unless @ARGV;
my ($count,$format,$interp,$file) = (1,'JSON'); #supply defaults;
my $opt = GetOptions
erAgent;
use JSON;
# default options
use constant DEFAULT_USER_AGENT => 'Mozilla/5.0';
use constant DEFAULT_LANG => 'en-US';
use constant BASE_URL => 'http://imdbapi.org/?type=json';
use Obje
earch($options);
if ( $response->is_success ) {
my @results;
for ( @{ decode_json( $response->content ) } ) {
my $result = WebService::IMDBAPI::Result->new( %{$_} );
nse->is_success ) {
my $result = WebService::IMDBAPI::Result->new(
%{ decode_json( $response->content ) } );
return $result;
}
else {
die $response->status
format => 'Text'); # uses Tool::Bench::Report::Text
$bench->report(format => 'JSON'); # uses Tool::Bench::Report::JSON
By using class names you can build your own report simply, see
L<Tool::Bench:
original data.
There are several well-known serialization method, such as L<Data::Dumper>,
L<JSON>, L<YAML>, L<PHP::Serialization>, L<Data::DumpXML>, etc. Each of them
has different benefits and
its. You should read their documents
for more information.
My favorite one is L<JSON>. It will try to use L<JSON::XS> when availible.
This one is both efficient and simple. Though you can only st
lessed object,
tied data, nor references that refer to the same variable or cyclic references (L<JSON>
will extract them independently and completely).
=item base64
It's not allowed to use all
=> sub{$naptime = rand(10)},
teardown => sub{$naptime = 1},
},
);
$bench->run(3);
print $bench->report(format => 'JSON');