File Coverage

blib/lib/Acme/NoTalentAssClown.pm
Criterion Covered Total %
statement 9 20 45.0
branch n/a
condition 0 8 0.0
subroutine 3 5 60.0
pod 2 2 100.0
total 14 35 40.0


line stmt bran cond sub pod time code
1             package Acme::NoTalentAssClown;
2 1     1   27821 use Lyrics::Fetcher;
  1         3299  
  1         23  
3              
4 1     1   6 use warnings;
  1         1  
  1         20  
5 1     1   4 use strict;
  1         6  
  1         170  
6              
7             sub new {
8 0     0 1   my ( $class, %options ) = @_;
9 0   0       $class = ref($class) || $class;
10 0           my $self = {
11             agent => $options{agent},
12             entire_collection => [
13             "That's What Love Is All About",
14             "The Dock Of The Bay",
15             "Soul Provider",
16             "How Am I Supposed To Live Without You",
17             "How Can We Be Lovers",
18             "When I'm Back On My Feet Again",
19             "Georgia On My Mind",
20             "Time, Love And Tenderness",
21             "When A Man Loves A Woman",
22             "Missing You Now",
23             "Steel Bars",
24             "Said I Loved You...But I Lied",
25             "Can I Touch You...There?",
26             "I Promise You",
27             "I Found Someone",
28             "A Love So Beautiful",
29             "This River"
30             ]
31             };
32 0           $Lyrics::Fetcher::gid = $options{gid};
33 0           bless( $self, $class );
34 0           return ($self);
35             }
36              
37             =head1 NAME
38              
39             Acme::NoTalentAssClown - Get some Bolton Lyrics!
40              
41             =head1 VERSION
42              
43             Version 0.01
44              
45             =head1 SYNOPSIS
46              
47             use Acme::NoTalentAssClown;
48              
49             #Defaults to use Lyrics::Fetcher::Google, but any Lyrics::Fetcher
50             #plugin will work as specified by agent=>'bar'
51             my $nta = Acme::NoTalentAssClown->new(gid=>'yourGoogleApi_ID');
52             print $nta->grammys(); #finds a greatest hit
53             print $nta->grammys('When a Man Loves a Woman'); #For my money, it doesn't get any better
54             ...
55              
56             =head1 METHODS
57              
58             =over 4
59              
60             =item new
61              
62             Initializes Acme::NoTalentAssClown and loads lyric loader depending on agent
63              
64             =item grammys
65              
66             Returns the result of a search for a random greatest hit, or a hit you specify
67              
68             =back
69              
70             =cut
71              
72              
73             our $VERSION = '0.01';
74              
75             sub grammys {
76 0     0 1   my $self = shift;
77 0           my ($suggestion) = @_;
78 0           $suggestion ||=
79             $self->{entire_collection}
80 0   0       [ rand( scalar( @{ $self->{entire_collection} } ) ) ];
81 0   0       return Lyrics::Fetcher->fetch(
82             $suggestion,
83             "Michael Bolton",
84             $self->{agent} || "Google"
85             );
86             }
87              
88             =head1 AUTHOR
89              
90             John Lifsey, C<< >>
91              
92             =head1 BUGS
93              
94             I'm sure there are plenty of bugs.
95             But why should I change it?
96             He's the one who sucks.
97              
98             Please report any bugs or feature requests to
99             C, or through the web interface at
100             L.
101             I will be notified, and then you'll automatically be notified of progress on
102             your bug as I make changes.
103              
104             =head1 COPYRIGHT & LICENSE
105              
106             Copyright 2005 John Lifsey, all rights reserved.
107              
108             This program is free software; you can redistribute it and/or modify it
109             under the same terms as Perl itself.
110              
111             =cut
112              
113             1; # End of Acme::NoTalentAssClown