lib/Bot/BasicBot/Pluggable/Module/IMDB.pm

filter: Statementstmt 41.6% 10 / 24 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 40.5% 15 / 37 CC 4 SCAR 23.6
CC
4
Cov
33%
said
20.0
help
2.0
BEGIN
1.0
CRAP 10.6
« blib/lib/Bot/BasicBot/Pluggable/Module/WebSearch.pm ↑ Summary lib/Bot/BasicBot/Pluggable/Module/Hyperarchive.pm »
1 package Bot::BasicBot::Pluggable::Module::IMDB;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Bot::BasicBot::Pluggable::Module;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use base qw(Bot::BasicBot::Pluggable::Module);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 0 ▶sub said {
Subroutine said: not called CC=4 SCAR=30.0
Pod documented
9 0 my ($self, $mess, $pri) = @_;
10  
11 0 my $body = $mess->{body};
12 0 my $who = $mess->{who};
13  
14 0 ▶ return unless ($pri == 2);
Branch: 1 branch
BranchTrueFalseTotal
unless $pri == 2 0 0 0
15  
16 0 ▶ return unless $body =~ s!^\s*imdb (for )?!!;
Branch: 1 branch
BranchTrueFalseTotal
unless $body =~ s/^\s*imdb (for )?// 0 0 0
17  
18  
19 0 my $date = "";
20 0 my $url = $body;
21 0 ▶ if ($url =~ s/( \(\d+\))$//) { $date = $1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($url =~ s/( \(\d+\))$//) 0 0 0
22  
23 0 $url =~ s/^(The|A|An|Les|Le|Das) (.*)/$2, $1/i;
24 0 $url = "http://www.imdb.com/M/title-substring?title=$url$date&type=fuzzy";
25 0 $url =~ s/ /+/g;
26 0 return "$body can be found at $url";
27  
28 }
29  
30 0 ▶sub help {
Subroutine help: not called CC=1 SCAR=6.9
Pod documented
31 0 return "Commands: 'imdb (for ) <word>'";
32 }
33  
34 1 1;
35  
36 =head1 NAME
37  
38 Bot::BasicBot::Pluggable::Module::IMDB - give the url of a search on IMDB
39  
40 =head1 SYNOPSIS
41  
42 This is almost useless but it's provided as part of Infobot backwards compatability.
43  
44 =head1 IRC USAGE
45  
46 imdb (for ) <word> [ <date> ]
47  
48 =head1 AUTHOR
49  
50 Simon Wistow, <simon@thegestalt.org>
51  
52 =head1 COPYRIGHT
53  
54 Copyright 2005, Simon Wistow
55  
56 Distributed under the same terms as Perl itself.
57  
58 =head1 SEE ALSO
59  
60  
61 =cut
62  
« blib/lib/Bot/BasicBot/Pluggable/Module/WebSearch.pm ↑ Summary lib/Bot/BasicBot/Pluggable/Module/Hyperarchive.pm »