Acme::NoTalentAssClown - Get some Bolton Lyrics!


Acme-NoTalentAssClown documentation Contained in the Acme-NoTalentAssClown distribution.

Index


Code Index:

NAME

Top

Acme::NoTalentAssClown - Get some Bolton Lyrics!

VERSION

Top

Version 0.01

SYNOPSIS

Top

    use Acme::NoTalentAssClown;

    #Defaults to use Lyrics::Fetcher::Google, but any Lyrics::Fetcher
    #plugin will work as specified by agent=>'bar'
    my $nta = Acme::NoTalentAssClown->new(gid=>'yourGoogleApi_ID'); 
    print $nta->grammys(); #finds a greatest hit
    print $nta->grammys('When a Man Loves a Woman'); #For my money, it doesn't get any better
    ...

METHODS

Top

new

Initializes Acme::NoTalentAssClown and loads lyric loader depending on agent

grammys

Returns the result of a search for a random greatest hit, or a hit you specify

AUTHOR

Top

John Lifsey, <nebulous@crashed.net>

BUGS

Top

I'm sure there are plenty of bugs. But why should I change it? He's the one who sucks.

Please report any bugs or feature requests to bug-acme-notalentassclown@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-NoTalentAssClown. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Top


Acme-NoTalentAssClown documentation Contained in the Acme-NoTalentAssClown distribution.
package Acme::NoTalentAssClown;
use Lyrics::Fetcher;

use warnings;
use strict;

sub new {
    my ( $class, %options ) = @_;
    $class = ref($class) || $class;
    my $self = {
        agent             => $options{agent},
        entire_collection => [
            "That's What Love Is All About",
            "The Dock Of The Bay",
            "Soul Provider",
            "How Am I Supposed To Live Without You",
            "How Can We Be Lovers",
            "When I'm Back On My Feet Again",
            "Georgia On My Mind",
            "Time, Love And Tenderness",
            "When A Man Loves A Woman",
            "Missing You Now",
            "Steel Bars",
            "Said I Loved You...But I Lied",
            "Can I Touch You...There?",
            "I Promise You",
            "I Found Someone",
            "A Love So Beautiful",
            "This River"
        ]
    };
    $Lyrics::Fetcher::gid = $options{gid};
    bless( $self, $class );
    return ($self);
}


our $VERSION = '0.01';

sub grammys {
    my $self = shift;
    my ($suggestion) = @_;
    $suggestion ||=
      $self->{entire_collection}
      [ rand( scalar( @{ $self->{entire_collection} } ) ) ];
    return Lyrics::Fetcher->fetch(
        $suggestion,
        "Michael Bolton",
        $self->{agent} || "Google"
    );
}

1;    # End of Acme::NoTalentAssClown