The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ICanHasCheezburger::lolcats - Retrieves the latest from ICanHasCheezburger.

SYNOPSIS

        use lolcats;
        my $lolcat = ICanHasCheezburger::lolcats->new;
        my $rofl = $lolcat->getImage;
        open(FILE, ">rofl.jpg");
        print FILE $rofl;
        close(FILE);

DESCRIPTION

This module is designed for retreiving lolcat images from the ICanHasCheezburger RSS feed using LWP.

Methods

new

        my $lolcat = ICanHasCheezburger::lolcats->new;
        my $lolcat = ICanHasCheezburger::lolcats->new( feedUrl => 'http://server.tld/feed.rss' );
        
        Creates a new object for retrieval of lolcats. If a C<$feedUrl> is given, it is passed to C<< $lolcat->feedUrl >> and will be used instead of the default.

feedUrl

        my $feedUrl = $lolcat->feedUrl;
        $lolcat->feedUrl($feedUrl);
        
        Gets or sets the Feed URL to use for retrieval of lolcats.
        

getImageUrl

        my $imageUrl = $lolcat->getImageUrl;
        
        Gets the URL for the latest image to be posted to the lolcats feed. Returns nothing on failure.

getImage

        my $image = $lolcat->getImage;
        my $image = $lolcat->getImage($imageUrl);
        
        Uses LWP to fetch C<$imageUrl>. If none is specified, will call C<< $lolcat->getImageUrl >> and fetch that. It will return the actual image, or nothing on failure.
        

getPageUrl

        my $pageUrl = $lolcat->getPageUrl;
        
        Gets the URL for the latest page to be posted to the lolcats feed. Returns nothing on failure.

getUpdatedTime

        my $lastUpdate = $lolcat->getUpdatedTime;
        
        Gets the time and date of the last update to the lolcats feed. Returns nothing on failure.

feed

        my $rssFeed = $lolcat->feed;
        
        Uses LWP to fetch C<< $self->feedUrl >>, and returns it. Returns nothing on failure.