The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

XML::RSS::Feed - Encapsulate RSS XML New Items Watching

SYNOPSIS

  #!/usr/bin/perl -w
  use strict;
  use XML::RSS::Feed;
  use LWP::Simple;

  my %source = (
      url   => "http://www.jbisbee.com/rdf/",
      name  => "jbisbee",
      delay => 10,
  );
  my $feed = XML::RSS::Feed->new(%source);

  while (1) {
      print "Fetching " . $feed->url . "\n";
      my $rssxml = get($feed->url);
      if (my @late_breaking_news = $feed->parse($rssxml)) {;
        for my $headline (@late_breaking_news) {
          print $headline->headline . "\n";
        }
      }
      sleep($feed->delay);
  }

DESCRIPTION

ATTENTION! - If you want a non-blocking way to watch multiple RSS sources with one process. Use POE::Component::RSSAggregator

AUTHOR

        Jeff Bisbee
        CPAN ID: JBISBEE
        cpan@jbisbee.com
        http://www.jbisbee.com/perl/modules/

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO

POE::Component::RSSAggregator, XML::RSS::Feed::Factory, XML::RSS::Feed::Headline