lib/Comics/Fetcher/GoComics.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 51.7% 15 / 29 CC 3 SCAR 18.7
CC
3
Cov
50%
register
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« blib/lib/Comics/Plugin/S1ngle.pm ↑ Summary blib/lib/Comics/Plugin/9ChickweedLane.pm »
1 #! perl
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Comics::Fetcher::GoComics;
7  
8 1 ▶use parent qw(Comics::Fetcher::Cascade);
Subroutine BEGIN: called CC=1 SCAR=0.0
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 our $name = "Garfield";
20 our $url = "https://www.comics.com/garfield";
21  
22 # Return the package name.
23 __PACKAGE__;
24  
25 =head1 DESCRIPTION
26  
27 The C<GoComics> Fetcher handles comics that are on the GoComics
28 websites (comics.com, gocomics.com).
29  
30 The Fetcher requires the common arguments:
31  
32 =over 8
33  
34 =item name
35  
36 The full name of this comic, e.g. "Garfield".
37  
38 =item url
39  
40 The base url of this comic.
41  
42 =back
43  
44 Fetcher specific arguments:
45  
46 =over 8
47  
48 =item None as yet.
49  
50 =back
51  
52 =cut
53  
54 1 our $VERSION = "1.04";
55  
56 # Page contents changed, january 10, 2017.
57 # Page contents changed, april 5, 2018.
58 # Page contents changed, april 1, 2025.
59  
60 0 ▶sub register {
Subroutine register: not called CC=3 SCAR=24.8
Pod documented
61 0 my ( $pkg, $init ) = @_;
62  
63 # Leave the rest to SUPER.
64 0 my $self = $pkg->SUPER::register($init);
65  
66 0 ▶ if ( ! $self->{url} && $self->{tag} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->{"url"} and $self->{"tag"}) 0 0 0
Condition0%0/3
not $self->{"url"} and $self->{"tag"}
!ll&&!rl&&r
000
MC/DC0%0/2
not $self->{"url"} and $self->{"tag"}
not $self->{"url"} $self->{"tag"}
Truth table0%0/3
not(A) and B
A= not $self->{"url"}B= $self->{"tag"}
ABresult
0X0
100
111
67 0 $self->{url} = "https?://www.gocomics.com/" . $self->{tag} . "/";
68 }
69  
70 # Add the standard pattern for GoComics comics.
71 $self->{patterns} =
72 [
73 0 qr{ <link \s+
74 rel="preload" \s+
75 as="image" \s+
76 imageSrcSet="
77 (?<url>https://featureassets.gocomics.com/assets/
78 (?<image>[0-9a-f]+))
79 }x,
80 ];
81  
82 0 return $self;
83 }
84  
85 1 1;
« blib/lib/Comics/Plugin/S1ngle.pm ↑ Summary blib/lib/Comics/Plugin/9ChickweedLane.pm »