line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# $Id: Dilbert.pm,v 1.3 2006/01/09 21:34:19 nicolaw Exp $ |
4
|
|
|
|
|
|
|
# WWW::Comic::Plugin::Dilbert - Dilbert of the Day plugin for WWW::Comic |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright 2006 Nicola Worthington |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
18
|
|
|
|
|
|
|
# limitations under the License. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
############################################################ |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package WWW::Comic::Plugin::Dilbert; |
23
|
|
|
|
|
|
|
# vim:ts=4:sw=4:tw=78 |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
2
|
|
3798
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
64
|
|
26
|
2
|
|
|
2
|
|
973
|
use WWW::Dilbert qw(); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use vars qw($VERSION @ISA %COMICS); |
29
|
|
|
|
|
|
|
$VERSION = sprintf('%d.%02d', q$Revision: 1.3 $ =~ /(\d+)/g); |
30
|
|
|
|
|
|
|
@ISA = qw(WWW::Comic::Plugin); |
31
|
|
|
|
|
|
|
%COMICS = ( dilbert => 'Dilbert of the Day' ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
|
|
|
|
|
|
my $class = shift; |
35
|
|
|
|
|
|
|
my $self = { comics => \%COMICS }; |
36
|
|
|
|
|
|
|
bless $self, $class; |
37
|
|
|
|
|
|
|
return $self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub strip_url { |
41
|
|
|
|
|
|
|
my $class = shift; |
42
|
|
|
|
|
|
|
my %param = @_; |
43
|
|
|
|
|
|
|
return WWW::Dilbert::strip_url($param{id}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub get_strip { |
47
|
|
|
|
|
|
|
my $class = shift; |
48
|
|
|
|
|
|
|
my %param = @_; |
49
|
|
|
|
|
|
|
return WWW::Dilbert::get_strip($param{url} || $param{id}); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub mirror_strip { |
53
|
|
|
|
|
|
|
my $class = shift; |
54
|
|
|
|
|
|
|
my %param = @_; |
55
|
|
|
|
|
|
|
my @opts = (); |
56
|
|
|
|
|
|
|
push @opts, $param{filename} if exists $param{filename}; |
57
|
|
|
|
|
|
|
push @opts, $param{url} if exists $param{url}; |
58
|
|
|
|
|
|
|
push @opts, $param{id} if exists $param{id}; |
59
|
|
|
|
|
|
|
return WWW::Dilbert::mirror_strip(@opts); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=pod |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 NAME |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
WWW::Comic::Plugin::Dilbert - Dilbert of the Day plugin for WWW::Comic |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SYNOPSIS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
See L. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This plugin requires L. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 VERSION |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$Id: Dilbert.pm,v 1.3 2006/01/09 21:34:19 nicolaw Exp $ |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Nicola Worthington |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 COPYRIGHT |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Copyright 2006 Nicola Worthington. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This software is licensed under The Apache Software License, Version 2.0. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|