NAME Plack::App::PubSubHubbub::Subscriber - PubSubHubbub subscriber implementation as a Plack App SYNOPSIS use Plack::Builder; use Plack::App::PubSubHubbub::Subscriber; use Plack::App::PubSubHubbub::Subscriber::Config; use Plack::App::PubSubHubbub::Subscriber::Client; my $conf = Plack::App::PubSubHubbub::Subscriber::Config->new( callback => "http://example.tld:8081/callback", lease_seconds => 86400, verify => 'sync', ); my $app = Plack::App::PubSubHubbub::Subscriber->new( config => $conf on_verify => sub { my ($topic, $token, $mode, $lease) = @_; ... return 1; }, on_ping => sub { my ($content_type, $content, $token) = @_; print $content; }, ); my $client = Plack::App::PubSubHubbub::Subscriber::Client( config => $conf, ); builder { mount $app->callback_path, $app; mount '/subscribe' => sub { ... $client->subscribe( $hub, $topic, $token ); ... }; mount '/unsubscribe' => sub { ... $client->unsubscribe( $hub, $topic, $token ); ... }; }; DESCRIPTION PubSubHubbub subscriber implementation in the form of a Plack app and a client. Originally developed for storyfindr.com $self->config( $conf ) Get/Set the Plack::App::PubSubHubbub::Subscriber::Config object. This same config object can be use to instanciate the client Plack::App::PubSubHubbub::Subscriber::Client $self->on_ping( sub { my ($content_type, $content, $token) = @_ } ) Triggered when a new ping is received, the parameters are the content type, the raw content, and the token in that order. Note that the token is available only if the configuration flag "token_in_path" is set (the default). Also note that, in any case, the token is undef if you didn't use a token to (un)subcribe. The return value is ignore. $self->on_verify( sub { my ($topic, $token, $mode, $lease) = @_ } ) Triggered when a subscribe/unsubscribe request is received, the parameters are the topic, the token, the mode, and the number of seconds of the lease, in that order. Note that the token is undef if you didn't use a token to (un)subcribe. Given these parameters, this coderef must return 1 for verified, or 0 for rejected. $self->callback_path Return the path part of the callback URL. Useful for doing "mount $app->callback_path, $app;" LIMITATION the "Authenticated Content Distribution" is not supported. SEE ALSO the specs , Net::PubSubHubbub::Publisher AUTHOR Antoine Imbert, "" LICENSE AND COPYRIGHT This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.