Mobile::Ads - base class for Mobile Ads


Mobile-Ads documentation  | view source Contained in the Mobile-Ads distribution.

Index


NAME

Top

Mobile::Ads - base class for Mobile Ads

Version 0.0.2

SYNOPSIS

Top

 use Mobile::Ads::Admob;

DESCRIPTION

Top

Mobile::Ads provides an object oriented interface to serve advertisements It does nothing by itself and you should probably use one of Mobile::Ads::AdMob_v1 (old AdMob implementation, lacks graphical ads) Mobile::Ads::AdMob_v2 (newer AdMob, support image ads) Mobile::Ads::Admoda Mobile::Ads::AdSense (Google AdSense for Mobile) Mobile::Ads::Adsgr (ads.gr mobile ads) Mobile::Ads::Adultmoda Mobile::Ads::Buzzcity Mobile::Ads::Decktrade Mobile::Ads::GetMobile Mobile::Ads::MoJiva Mobile::Ads::ZastAdz

Refer to their man pages for help (?)

new Mobile::Ads

Top

Methods

get_ad

=> Does the actual HTTP. url is obviously the ad serving site URL, method is either ``POST'' or anything else (in which case a GET is performed) and params is a hash reference with key/value pairs. The module will take care to URLEncode as neccessary or set Content-length and Content-type if POST. Note that you can either construct a GET URI yourself (taking care of encoding and stuff or pass the arguments in params, but not both).

Example: $response = $ad->get_ad ( { url => 'http://ad.serving.site/ad.php', method => 'GET', params => { 'some' => 'params' 'can' => 'go here' } });

will result in ``http://ad.serving.site/ad.php?some=params&can=go%20here'' being actually sent to the server.

Will happily croak() if server is unreachable or not return 200, so eval() as neccessary. Will NOT apply any kind of translation to the returned content. For this, each module should make provisions for itself.

URLEncode

=> Shamelessly plugged from Apache::ASP::Server::URLEncode

XMLEncode

=> Just escapes ``&'' where neccessary in its input to make it XML safe. Proably of use to everyone, so put here.

Revision History

Top

 0.0.1 
	Initial Release
 0.0.2 
	First CPAN released version and the addition of $self->timeout to easily set
	LWP::UserAgent timeout

BUGS

Top

Thoughtlessly crafted to avoid having the same piece of code in several places. Could use lots of enhancements.

DISCLAIMER

Top

This module borrowed its OO interface from Mail::Sender.pm Version : 0.8.00 which is available on CPAN.

AUTHOR

Top

Thanos Chatziathanassiou <tchatzi@arx.net> http://www.arx.net

COPYRIGHT

Top


Mobile-Ads documentation  | view source Contained in the Mobile-Ads distribution.