NAME
Sledge::Plugin::Affiliate - easy to send notice request to affiliate site
SYNOPSIS
package Your::Pages;
use Sledge::Plugin::Affiliate;
sub dispatch_index {
my $self = shift;
$self->affiliate->get_from_request;
}
sub dispatch_do_regist {
my $self = shift;
$self->affiliate->send_notice(unique_id => 'timpo at ma.la';
}
package Your::Config;
$C{AFFILIATE} = {
ua_opts => {
agent => 'Sledge::Plugin::Affiliate/0.01',
timeout => 60,
},
sites => [
{
name => 'ktaf',
param => 'ktaf',
url => 'http://www.example.com/action-notice.cgi?a=ADM$KDDF&u={UNIQUE_ID}&r={SESSION_ID}',
},
],
};
DESCRIPTION
Sledge::Plugin::Affiliate is easy to send notice request to the affiliate site plugin, for Sledge.
METHODS
new
Sledge::Plugin::Affiliate->new;
create new instance.
set
$a->set('ktaf' => 'dsfau0JKLm');
save affiliate info to session.
get
$a->get;
get the affiliate info from session.
get_from_request
$a->get_from_request;
get the affiliate info from request, and save to session.
send_notice
$a->send_notice;
send the notice request to affiliate site(e.g. http://ktaf.jp/)
store_to_cache
$a->store_to_cache;
copy affiliate info to cache(Sledge::Cache).
load_from_cache
$a->load_from_cache;
load affiliate info from cache.
as_string
$a->as_string;
dump the affiliate info.
I suggest this string save to database before send notice message.
AUTHOR
MATSUNO Tokuhiro <tokuhiro at mobilefactory.jp>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.