| Mobile-Ads documentation | view source | Contained in the Mobile-Ads distribution. |
Mobile::Ads::Zestadz - module to serve Zestadz ads
Version 0.1.0
use Mobile::Ads::Zestadz([$parent]);
$ad = new Mobile::Ads::Zestadz
($text,$link,$image) = $ad->get_zestadz_ad({
site => 'AdMob site code',
remote => $ENV{'HTTP_USER_AGENT'},
address => $ENV{'REMOTE_ADDR'},
text => 'default ad text',
link => 'default ad link',
test => 'set this if this is a test ad',
});
Mobile::Ads::Zestadz provides an object oriented interface to serve advertisements
from AdMob in mobile sites.
This was ported from VB code in their site
To reuse Mobile::Ads in multiple (subsequent) ad requests, you can pass a Mobile::Ads
reference here. Instead of creating a new Mobile::Ads object, we will use the one you
pass instead. This might save a little LWP::UserAgent creation/destruction time.
=> Zestadz site code, delivered by them. Something in the form off ``01234abcdef12345''
=> Remote User Agent ($ENV{'HTTP_USER_AGENT'}). In fact $ENV{'HTTP_USER_AGENT'} will be used
if not supplied.
=> $ENV{'REMOTE_ADDR'}. All things about HTTP_USER_AGENT also apply here.
=> Should we fail to retrieve a real ad, this is the text of the ad displayed instead
=> Same with text, but for the ad's link.
=> Does the actual fetching of the ad for the site given. Refer to new for details
Returns a list ($text_for_ad,$link_for_ad) value in list context or an
``<a href="$link">$text</a>'' if called in scalar context.
0.0.1 Initial Release 0.0.2 Fixed stupid typo 0.0.3 Didn't preserve default values on failure 0.0.4 $ua timeout set to 20 sec 0.0.5 All ua stuff put in Mobile::Ads 0.0.6 Aliased get_ad to get_zestadz_ad 0.0.7 Option to reuse parent Mobile::Ads instead of creating anew 0.0.8/0.0.9 Skipped those to have same verion number in all modules 0.1.0 One could also use a reference to the parent... :)
Thoughtlessly crafted to avoid having the same piece of code in several places. Could use lots of enhancements.
This module borrowed its OO interface from Mail::Sender.pm Version : 0.8.00 which is available on CPAN.
Thanos Chatziathanassiou <tchatzi@arx.net> http://www.arx.net
Copyright (c) 2008 arx.net - Thanos Chatziathanassiou . All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Mobile-Ads documentation | view source | Contained in the Mobile-Ads distribution. |