Acme::ICHC::Lolcats - Retrieves the latest from ICanHasCheezburger.
use Acme::ICHC::Lolcats; my $lolcat = Acme::ICHC::Lolcats->new; my $rofl = $lolcat->getImage; open(FILE, ">rofl.jpg"); print FILE $rofl; close(FILE);
This module is designed for retreiving lolcat images from the ICanHasCheezburger RSS feed using LWP.
my $lolcat = Acme::ICHC::Lolcats->new; my $lolcat = Acme::ICHC::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.
my $feedUrl = $lolcat->feedUrl; $lolcat->feedUrl($feedUrl); Gets or sets the Feed URL to use for retrieval of lolcats.
my $imageUrl = $lolcat->getImageUrl; Gets the URL for the latest image to be posted to the lolcats feed. Returns nothing on failure.
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.
my $pageUrl = $lolcat->getPageUrl; Gets the URL for the latest page to be posted to the lolcats feed. Returns nothing on failure.
my $lastUpdate = $lolcat->getUpdatedTime; Gets the time and date of the last update to the lolcats feed. Returns nothing on failure.
my $rssFeed = $lolcat->feed; Uses LWP to fetch C<< $self->feedUrl >>, and returns it. Returns nothing on failure.
To install Acme::ICHC::Lolcats, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::ICHC::Lolcats
CPAN shell
perl -MCPAN -e shell install Acme::ICHC::Lolcats
For more information on module installation, please visit the detailed CPAN module installation guide.