AnyEvent::Superfeedr - XMPP interface to Superfeedr service.
use AnyEvent::Superfeedr; my $callback = sub { my AnyEvent::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; } }; my $superfeedr = AnyEvent::Superfeedr->new( jid => $jid, password => $password on_notification => $callback, ); $superfeedr->connect; AnyEvent->condvar->recv; # Subsribe upon connection my $superfeedr = AnyEvent::Superfeedr->new( jid => $jid, password => $password, ); $superfeedr->connect(sub { $superfeedr->subscribe($feed_uri) }); # Periodically fetch new URLs from database and subscribe my $timer = AnyEvent->timer( after => 5, interval => 5 * 60, cb => sub { my @new_feeds = get_new_feeds_from_database() or return; $superfeedr->subscribe(@new_feeds); }, ); $end->recv;
WARNING: the interface is likely to change in the future.
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.
see in the eg/ directory of the distribution.
Yann Kerherve <yannk@cpan.org>
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AnyEvent::XMPP AnyEvent http://superfeedr.com
To install AnyEvent::Superfeedr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::Superfeedr
CPAN shell
perl -MCPAN -e shell install AnyEvent::Superfeedr
For more information on module installation, please visit the detailed CPAN module installation guide.