Acme::ICHC::Lolcats - Retrieves the latest from ICanHasCheezburger.


Acme-ICHC-Lolcats documentation  | view source Contained in the Acme-ICHC-Lolcats distribution.

Index


NAME

Top

Acme::ICHC::Lolcats - Retrieves the latest from ICanHasCheezburger.

SYNOPSIS

Top

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

DESCRIPTION

Top

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

Methods

new

	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.

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.


Acme-ICHC-Lolcats documentation  | view source Contained in the Acme-ICHC-Lolcats distribution.