NAME
AnyEvent::Superfeedr - XMPP interface to Superfeedr service.
SYNOPSIS
use AnyEvent::Superfeedr;
$end = AnyEvent->condvar;
## receive 20 notifications and stop
$n = 0;
$callback = sub {
my Net::Superfeedr::Notification $notification = shift;
my $feed_uri = $notification->feed_uri;
my $http_status = $notification->http_status;
my $next_fetch = $notification->next_fetch;
printf "status %s for %s. next: %s\n",
$http_status, $feed_uri, $next_fetch;
for my XML::Atom::Entry $entry ($notification->entries) {
printf "Got: %s\n" $entry->title;
}
$end->send if ++$n == 20;
};
$superfeedr = AnyEvent::Superfeedr->new(
jid => $jid,
password => $password
subscription => {
interval => 5,
sub_cb => \%get_new_feeds,
unsub_cb => \%get_feeds2delete,
},
on_notification => $callback,
);
$superfeedr->subscribe($feed_uri);
$superfeedr->unsubscribe($feed_uri);
$end->recv;
DESCRIPTION
Allows you to subscribe to feeds and get notified real-time about new content.
This is a first version of the api, and probably only covers specific architectural needs.
AUTHOR
Yann Kerherve <yannk@cpan.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.