line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#! perl |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
964
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Comics::Fetcher::GoComics; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use parent qw(Comics::Fetcher::Cascade); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Comics::Fetcher::GoComics -- Fetcher for GoComics. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
package Comics::Plugin::Garfield; |
17
|
|
|
|
|
|
|
use parent qw(Comics::Fetcher::GoComics); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub register { |
20
|
|
|
|
|
|
|
shift->SUPER::register |
21
|
|
|
|
|
|
|
( { name => "Garfield", |
22
|
|
|
|
|
|
|
url => "http://www.comics.com/garfield", |
23
|
|
|
|
|
|
|
} ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
# Return the package name. |
26
|
|
|
|
|
|
|
__PACKAGE__; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
The C Fetcher handles comics that are on the GoComics |
31
|
|
|
|
|
|
|
websites (comics.com, gocomics.com). |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
The Fetcher requires the common arguments: |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=over 8 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item name |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
The full name of this comic, e.g. "Garfield". |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item url |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The base url of this comic. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=back |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Fetcher specific arguments: |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=over 8 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item None as yet. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=back |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
our $VERSION = "1.02"; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Page contents changed, january 10, 2017. |
60
|
|
|
|
|
|
|
# Page contents changed, april 5, 2018. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub register { |
63
|
0
|
|
|
0
|
1
|
|
my ( $pkg, $init ) = @_; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# Leave the rest to SUPER. |
66
|
0
|
|
|
|
|
|
my $self = $pkg->SUPER::register($init); |
67
|
|
|
|
|
|
|
|
68
|
0
|
0
|
0
|
|
|
|
if ( ! $self->{url} && $self->{tag} ) { |
69
|
0
|
|
|
|
|
|
$self->{url} = "http://www.gocomics.com/" . $self->{tag} . "/"; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Add the standard pattern for GoComics comics. |
73
|
|
|
|
|
|
|
$self->{patterns} = |
74
|
|
|
|
|
|
|
[ |
75
|
0
|
|
|
|
|
|
qr{ href="(?.*?)">Comics |
76
|
|
|
|
|
|
|
}x, |
77
|
|
|
|
|
|
|
qr{
|
78
|
|
|
|
|
|
|
content="(?https?://assets.amuniversal.com/ |
79
|
|
|
|
|
|
|
(?[0-9a-f]+))" \s+ |
80
|
|
|
|
|
|
|
/> |
81
|
|
|
|
|
|
|
}x, |
82
|
|
|
|
|
|
|
]; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |