File Coverage

blib/lib/WWW/FetchStory/Fetcher/Default.pm
Criterion Covered Total %
statement 9 17 52.9
branch n/a
condition n/a
subroutine 3 6 50.0
pod 3 3 100.0
total 15 26 57.6


line stmt bran cond sub pod time code
1             package WWW::FetchStory::Fetcher::Default;
2             $WWW::FetchStory::Fetcher::Default::VERSION = '0.2602';
3 1     1   209390 use strict;
  1         3  
  1         44  
4 1     1   6 use warnings;
  1         2  
  1         109  
5             =head1 NAME
6              
7             WWW::FetchStory::Fetcher::Default - default fetching module for WWW::FetchStory
8              
9             =head1 VERSION
10              
11             version 0.2602
12              
13             =head1 DESCRIPTION
14              
15             This is the default story-fetching plugin for WWW::FetchStory.
16              
17             =cut
18              
19 1     1   8 use parent qw(WWW::FetchStory::Fetcher);
  1         2  
  1         9  
20              
21             =head1 METHODS
22              
23             =head2 info
24              
25             Information about the fetcher.
26              
27             $info = $self->info();
28              
29             =cut
30              
31             sub info {
32 0     0 1   my $self = shift;
33            
34 0           my $info = "Default fetcher (does not do much)";
35              
36 0           return $info;
37             } # info
38              
39              
40             =head2 priority
41              
42             The priority of this fetcher. Fetchers with higher priority
43             get tried first. This is useful where there may be a generic
44             fetcher for a particular site, and then a more specialized fetcher
45             for particular sections of a site. For example, there may be a
46             generic LiveJournal fetcher, and then refinements for particular
47             LiveJournal community, such as the sshg_exchange community.
48             This works as either a class function or a method.
49              
50             This must be overridden by the specific fetcher class.
51              
52             $priority = $self->priority();
53              
54             $priority = WWW::FetchStory::Fetcher::priority($class);
55              
56             =cut
57              
58             sub priority {
59 0     0 1   my $class = shift;
60              
61 0           return 0;
62             } # priority
63              
64             =head2 allow
65              
66             If this fetcher can be used for the given URL, then this returns
67             true.
68             This must be overridden by the specific fetcher class.
69              
70             if ($obj->allow($url))
71             {
72             ....
73             }
74              
75             =cut
76              
77             sub allow {
78 0     0 1   my $self = shift;
79 0           my $url = shift;
80              
81 0           return 1;
82             } # allow
83              
84             1; # End of WWW::FetchStory::Fetcher
85             __END__