LinkBanner.pm - Respond for CGI as the link banner image or the links page of referers |
LinkBanner.pm - Respond for CGI as the link banner image or the links page of referers
$Id: LinkBanner.pm,v 1.6 2002/04/11 15:06:57 T.Shigetome Exp $
This will respond a banner image and will log referer address. That referer information is used for to make links list.
use LinkBanner; my($banner) = new LinkBanner("/home/foo/public_html/log_path/"); $banner->RecordLog(); $banner->OutBanner("/home/foo/public_html/cgi-bin/testbanner.jpg");
use LinkBanner; my($banner) = new LinkBanner("/home/foo/public_html/log_path/"); $banner->deny("/home/foo/public_html/deny_list.txt"); $banner->OutLinkPage();
This will automatically create link page. If some web contents reference to CGI program is useing this module, that will respond banner image. At that time also this module will be logging address of reference page. When required links page, this will generate from that logged file.
$logpath
,$query
])my($banner) = new LinkBanner;
or
my($logpath) = "/home/foo/public_html/log_path/"; my($banner) = new LinkBanner($logpath);
or
my($logpath) = "/home/foo/public_html/log_path/"; my($query) = new CGI; my($banner) = new LinkBanner($logpath,$query);
$logpath
)$banner->RecordLog();
or
$banner->RecordLog(C<$logpath>);
$img_file
[,$lifetime
,$basetime
])$img_file
specify file of banner image.
The $lifetime
specify period of cacheing banner image.
The $basetime
specify created time of banner image.
That banner image will be expired at $basetime
+ $lifetime
.
These arguments override default value.
$banner->OutBanner("/home/foo/public_html/image.gif");
$ra_sorteddata
, $rs_template
])$ra_sorteddata
is reference of logged data array.
The $rs_template
is reference of template that is used for page of links.
These arguments override default value.
$banner->OutLinkPage();
deny($filename)
$banner->deny("/home/foo/public_html/deny_list.txt");
Example describe denied link address
http://localhost http://www.denied.com
debug($debug_opt)
$banner->debug('template');
Message of debugging will be outputted to STDERR. Also. you can log by redirect STDERR with debuglog.pl or another way.
When you terminate debugging, you can strip debugging code from this module. All of debugging code are between line of `#>>>DEBUG_CODE'. These are able to strip by striper.pl.
$rs_buffer
, $template
,])The $rs_buffer
specify reference of template buffer that used as argument of OutLinkpage
.
The $template
specify filename of template.
strict.pm, Carp.pm, File::Basename, URI::Escape, CGI Timestr.pm, regexpr.pl, jcode.pl
Describe as following to your Web contents.
<IMG SRC="http://www.any.com/~foo/cgi-bin/linkbanner.cgi?title=title%20of%20your%20page;topic=topic%20of%20your%20page" ALT="Link banner">
You must adjust to your page about `title%20of%20your%20page
' and `topic%20of%20your%20page
' fields.
Don't use HTML tag.
Locate `template.html' as template file in the log file path.
Example template.html ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01/EN"> <HTML lang="ja"> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS"> <TITLE>Links page</TITLE> </HEAD> <BODY> <H1>Links page</H1> <HR> <TABLE border="1" cellspacing="0"> <THEAD> <TR> <TH>Title</TH><TH>topic</TH> </TR> </THEAD> <TBODY> <!-- Following comment statements will be replaced to link list. You can customize that. These keywords will be handled about specified link banner parameter. Like as...
%referer% : URL of linked content that will reference the link banner. %title% : Title of linked page %topic% : Topic of linked page --> <!-- __Links_Replace_to_Here__ <TR><TD><A HREF="%referer%">%title%</A></TD><TD>%topic%</TD></TR> __Links_Replace_to_Above__ --> </TBODY> </TABLE> <HR> </BODY> </HTML>
Tetsuya Shigetome, <t_shigetome@muf.biglobe.ne.jp>.
o Simplified filter rouitne
o Change using module from timestr.pl to Timestr.pm
Fixed bugs
o Sort order is not numericaly.
o Delete new record in FilterSimpleDuplicated.
Fixed problem
o Log file grow too big.
Fixed bugs
o Duplicate default references.
o Jammed unescaped argument.
o Stricts match expression, so it need change of replace keyword.
Some warning miss match to debug option.
First release of LinkBanenr
LinkBanner.pm - Respond for CGI as the link banner image or the links page of referers |