sage::Passing>, filtering JSON messages into
specified exchanges with specified routeing keys.
=over
=item *
The exchange is specified by the C<@exchange> field in the JSON data.
=item *
The rout
eing key is specified by the C<@rk> field in the JSON data.
=back
=head1 AUTHOR
Dave Lambley, based on work by Tomas (t0m) Doran.
=head1 LICENSE
GNU Affero General Public License, Version 3
=cut
package Message::Passing::Output::AMQP::Proxy;
use Moose;
use namespace::autoclean;
use JSON qw/ decode_json /;
with qw/
Message::Passing::AMQP::Role::HasAChannel
Message::Passing::Role::Outp
erialized data - is a perl reference. Dropping.\n");
return;
}
my $hash = decode_json($data);
$self->_channel->publish(
body => $data,
exchange => $hash->{'@excha
:Tiny();
use List::Util qw(shuffle);
use List::MoreUtils qw(uniq );
use JSON();
use Carp;
use Any::URI::Escape;
our $JSON = JSON->new->utf8(1);
#===================================
sub new {
#======
p}->get( $server . $qs );
if ( $response->{success} ) {
my $content = eval { $JSON->decode( $response->{content} ) }
or warn "Decoding response from ($server): "
ent;
use Data::Printer;
use JSON;
use Moo;
our $VERSION = "0.003";
sub get_user {
my ( $self, $username ) = @_;
my $uri = "http://coderwall.com/$username.json";
my %user_data = %{$s
->http_agent->get($uri);
if ( $response->is_success ) {
my $json = JSON->new->allow_nonref;
return $json->decode( $response->decoded_content );
}
die __PACKAGE__.' API
:User> object given a username.
=head2 _call_api
Takes a URI, calls it, and returns the decoded json response.
For internal use. Use get_user or another get_* function instead.
=head1 SEE ALSO
L<
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=head1 GET THE SOURCE
http://code.google.com/p/ebay-api-simpl
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=cut
sub new {
my $class = shift;
my $api_args = s
head2 response_json
Not implemented yet.
=cut
sub response_json {
my $self = shift;
if ( ! defined $self->{response_json} ) {
$self->{response_json} = ''; # xml2json( $self->{respo
se Log::Dispatch;
use Log::Dispatch::Message::Passing;
use Message::Passing::Filter::Encoder::JSON;
use Message::Passing::Output::ZeroMQ;
my $log = Log::Dispatch->new;
$log->add(Log::Dispa
egate_log',
min_level => 'debug',
output => Message::Passing::Filter::Encoder::JSON->new(
output_to => Message::Passing::Output::ZeroMQ->new(
connect =>
elf->api_config->{siteid} ||= 'EBAY-US';
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaults()
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=head1 GET THE SOURCE
http://code.google.com/p/ebay-api-simpl
ping>
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=head1 AUTHOR
Tim Keefer <tim@timkeefer.com>
=cut
1;
;
$self->api_config->{siteid} ||= 0;
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaul
elf->api_config->{siteid} ||= 'EBAY-US';
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaults()
ebHooks::Event::Call::Failure';
use aliased 'Message::Passing::WebHooks::Event::Bad';
use JSON qw/ encode_json /;
use namespace::autoclean;
our $VERSION = '0.007';
$VERSION = eval $VERSION;
with 'Me
_json($data->{data});
# XXX FIXME http://wiki.shopify.com/Verifying_Webhooks
# HMAC goes here.
#warn "MAKE POST to " . $data->{url};
my $headers = { 'Content-Type' => 'application/json
POST /test HTTP/1.1
Host: localhost:5000
Content-Length: 13
Content-Type: application/json
{"foo":"bar"}
# Consume messages from ZeroMQ, and publish results to
# ZeroMQ:
>.
=item tmpdir
Default: guessed via C<File::Spec::tmpdir()>.
Name of URI parameter to specify JSON callback function name. Defaults
to C<callback>. Only effective when C<allow_callback> is turned
Riak::Role::Bucket;
{
$Data::Riak::Role::Bucket::VERSION = '2.0';
}
use Moose::Role;
use JSON 'decode_json';
use Data::Riak::Link;
use Data::Riak::MapReduce;
use HTTP::Headers::ActionPack::LinkList
_;
my ($result) = $map_reduce_results->results->[0];
my ($count) = decode_json($result->value) || 0;
return $count->[0];
},
);
}
sub linkwalk {
my
index({
%{ $opts || {} },
retval_mangler => sub { [sort map { $_->[1] } @{ decode_json shift }] },
});
}
1;
__END__
=pod
=head1 NAME
Data::Riak::Role::Bucket
=head1 VERSION
$Data::Riak::Request::ListBuckets::VERSION = '2.0';
}
use Moose;
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
sub as_http_request_args {
my ($self) = @_;
return {
json',
};
}
sub _mangle_retval {
my ($self, $ret) = @_;
$ret->json_value->{buckets};
}
with 'Data::Riak::Request';
has '+result_class' => (
default => Data::Riak::Result::SingleJSON
pReduce::Phase::Link;
{
$Data::Riak::MapReduce::Phase::Link::VERSION = '1.1';
}
use Moose;
use JSON::XS ();
# ABSTRACT: Link phase of a MapReduce
with ('Data::Riak::MapReduce::Phase');
has buck
sub pack {
my $self = shift;
my $href = {};
$href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
$href->{bucket} = $self->bucket if $self->has_buck
k;
use Data::Riak::MapReduce::Phase::Map;
use Data::Riak::MapReduce::Phase::Reduce;
use JSON::XS qw/encode_json/;
with 'Data::Riak::Role::HasRiak';
has inputs => (
is => 'ro',
isa => 'Arra
riak->send_request({
content_type => 'application/json',
method => 'POST',
uri => 'mapred',
data => encode_json({
inputs => $self->inputs,
query
Data::Riak::Request::ListBucketKeys::VERSION = '2.0';
}
use Moose;
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
sub as_http_request_args {
my ($self) = @_;
return {
=> 'application/json',
query => {
keys => 'true',
props => 'false',
},
};
}
sub _mangle_retval {
my ($self, $ret) = @_;
$ret->json_value->{keys};
a::Riak::Request::WithBucket';
has '+result_class' => (
default => Data::Riak::Result::SingleJSONValue::,
);
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=head1 NAME
Data::Riak::Reque
$Data::Riak::Request::SetBucketProps::VERSION = '2.0';
}
use Moose;
use JSON 'encode_json';
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
has props => (
is => 'ro',
('buckets/%s/props', $self->bucket_name),
content_type => 'application/json',
data => encode_json $self->props,
};
}
with 'Data::Riak::Request::WithBucket';
has '+result_
:Object;
use Data::Riak::Exception::FunctionFailed;
use Data::Riak::Exception::Timeout;
use JSON 'encode_json';
use namespace::autoclean;
has data => (
is => 'ro',
isa => 'HashRef'
'POST',
uri => 'mapred',
content_type => 'application/json',
data => encode_json($self->data),
($self->chunked ? (query => { chunked => 'true' }) : ())
Riak::MapReduce::Phase::Map::VERSION = '1.1';
}
use Moose;
use Moose::Util::TypeConstraints;
use JSON::XS ();
# ABSTRACT: Map phase of a MapReduce
with ('Data::Riak::MapReduce::Phase');
has langu
'
);
sub pack {
my $self = shift;
my $href = {};
$href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
$href->{language} = $self->language;
$href->{name}