App-jupiter
view release on metacpan or search on metacpan
script/jupiter view on Meta::CPAN
B<code> is the HTTP status code we got while fetching the feed.
B<doc> is the L<XML::LibXML::Document>. Could be either Atom or RSS!
=cut
# Creates list of feeds. Each feed is a hash with keys title, url, opml_file,
# cache_dir and cache_file.
sub read_opml {
my (@feeds, @files);
my @filters = map { decode(locale => substr($_, 1, -1)) } grep /^\/.*\/$/, @_;
for my $file (grep /\.opml$/, @_) {
my $doc = XML::LibXML->load_xml(location => $file); # this better have no errors!
my @nodes = $doc->findnodes('//outline[./@xmlUrl]');
my ($name, $path) = fileparse($file, '.opml', '.xml');
for my $node (@nodes) {
my $title = xml_escape $node->getAttribute('title');
my $url = xml_escape $node->getAttribute('xmlUrl');
next if @filters > 0 and not grep { $url =~ /$_/ or $title =~ /$_/ } @filters;
my $link = xml_escape $node->getAttribute('htmlUrl');
push @feeds, {
( run in 1.417 second using v1.01-cache-2.11-cpan-ceb78f64989 )