Cnutt::Feed::Actions::List - List the feeds of a webpage


cnutt-feed documentation Contained in the cnutt-feed distribution.

Index


Code Index:

NAME

Top

Cnutt::Feed::Actions::List - List the feeds of a webpage

VERSION

Top

Version 1.0

DESCRIPTION

Top

This file is part of cnutt-feed. You should read its documentation.

ls

Given an url, display the list of feeds found on the page.


cnutt-feed documentation Contained in the cnutt-feed distribution.
package Cnutt::Feed::Actions::List;

use strict;
use warnings;

our $VERSION = '1.0';

use XML::Feed;

sub ls {
    my ($roptions, $url) = @_;
    my %options = %{$roptions};

    print "Searching feeds in $url...\n" if $options{verbose};

    # get the feeds list
    my @feeds = XML::Feed->find_feeds($url);

    # print list
    map {print $_, "\n"} @feeds;

    my $count = @feeds;
    print "Found $count feed(s)\n" if $options{verbose};
}

1;