| 1 | package Cnutt::Feed::Actions::List; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | =head1 NAME | ||||||||||
| 7 | |||||||||||
| 8 | Cnutt::Feed::Actions::List - List the feeds of a webpage | ||||||||||
| 9 | |||||||||||
| 10 | =head1 VERSION | ||||||||||
| 11 | |||||||||||
| 12 | Version 1.0 | ||||||||||
| 13 | |||||||||||
| 14 | =cut | ||||||||||
| 15 | |||||||||||
| 16 | 2 | our $VERSION = '1.0'; | |||||||||
| 17 | |||||||||||
| 18 | =head1 DESCRIPTION | ||||||||||
| 19 | |||||||||||
| 20 | This file is part of cnutt-feed. You should read its documentation. | ||||||||||
| 21 | |||||||||||
| 22 | =cut | ||||||||||
| 23 | |||||||||||
| 24 | 2 | ▶ | use XML::Feed; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | =head2 ls | ||||||||||
| 27 | |||||||||||
| 28 | Given an url, display the list of feeds found on the page. | ||||||||||
| 29 | |||||||||||
| 30 | =cut | ||||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | sub ls { | ||||||||
|
Subroutine
ls: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 33 | 0 | my ($roptions, $url) = @_; | |||||||||
| 34 | 0 | my %options = %{$roptions}; | |||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | print "Searching feeds in $url...\n" if $options{verbose}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | |||||||||||
| 38 | # get the feeds list | ||||||||||
| 39 | 0 | my @feeds = XML::Feed->find_feeds($url); | |||||||||
| 40 | |||||||||||
| 41 | # print list | ||||||||||
| 42 | 0 | map {print $_, "\n"} @feeds; | |||||||||
| 43 | |||||||||||
| 44 | 0 | my $count = @feeds; | |||||||||
| 45 | 0 | ▶ | print "Found $count feed(s)\n" if $options{verbose}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 2 | 1; | |||||||||
| 49 | |||||||||||