Ark-Plugin-ReproxyCallback
view release on metacpan or search on metacpan
"requires" : {
"Test::CPAN::Meta" : "0",
"Test::MinimumVersion" : "0.10108",
"Test::Pod" : "1.41",
"Test::Spellunker" : "v0.2.7"
}
},
"runtime" : {
"requires" : {
"Ark::Plugin" : "0",
"HTTP::Request" : "0",
"URI" : "0",
"perl" : "5.008001"
}
},
"test" : {
"requires" : {
"Test::More" : "0.98"
}
}
},
- author
- builder
provides:
Ark::Plugin::ReproxyCallback:
file: lib/Ark/Plugin/ReproxyCallback.pm
version: 0.02
Ark::Plugin::ReproxyCallback::OpenSocial:
file: lib/Ark/Plugin/ReproxyCallback/OpenSocial.pm
requires:
Ark::Plugin: 0
HTTP::Request: 0
URI: 0
perl: 5.008001
resources:
bugtracker: https://github.com/ark-framework/Ark-Plugin-ReproxyCallback/issues
homepage: https://github.com/ark-framework/Ark-Plugin-ReproxyCallback
repository: git://github.com/ark-framework/Ark-Plugin-ReproxyCallback.git
version: 0.02
x_contributors:
- 'Songmu <y.songmu@gmail.com>'
requires 'Ark::Plugin';
requires 'HTTP::Request';
requires 'URI';
requires 'perl', '5.008001';
on configure => sub {
requires 'CPAN::Meta';
requires 'CPAN::Meta::Prereqs';
requires 'Module::Build';
};
on test => sub {
lib/Ark/Plugin/ReproxyCallback/OpenSocial.pm view on Meta::CPAN
package Ark::Plugin::ReproxyCallback::OpenSocial;
use strict;
use warnings;
use Ark::Plugin;
use HTTP::Request;
requires 'reproxy';
has reproxy_callback_opensocial_oauth_consumer_model => (
is => 'rw',
isa => 'Str',
lazy => 1,
default => sub {
my ($self) = @_;
$self->class_config->{oauth_consumer_model} || 'oauth_consumer';
lib/Ark/Plugin/ReproxyCallback/OpenSocial.pm view on Meta::CPAN
my $path = shift;
my $args = @_ > 1 ? {@_} : $_[0];
my $cb = delete $args->{callback};
my $params = delete $args->{params};
my $uri = URI->new( $c->reproxy_callback_opensocial_api_endpoint . $path );
$uri->query_form(%$params) if $params;
$c->reproxy(
request => HTTP::Request->new( $method => $uri ),
callback => $cb,
);
}
sub reproxy_people {
my $cb = pop @_;
my ($c, $guid, $target, $params) = @_;
my $uri = URI->new( $c->reproxy_callback_opensocial_api_endpoint );
$uri->path( $uri->path . "/people/${guid}/${target}" );
$uri->query_form(%$params) if $params;
$c->reproxy(
request => HTTP::Request->new( GET => $uri ),
callback => $cb,
);
}
1;
( run in 0.493 second using v1.01-cache-2.11-cpan-de7293f3b23 )