jdante
05-10-2001, 12:58 AM
I wrote this to add banner exchange code to the bottom of TGP galleries. It can be modified for any banner exchange or any footer you want to add. It pulls everything in a directory and modifies the .htm and .html pages.
I do a lot of TG production. There are plenty of programs that make the thumbs and the page html. There are plenty of search and replace programs for modifying multiple TG pages at once. This adds the unique page # for the banner code so you get credit for every page view.
Cut and paste it to a text editor and save it as a .pl or .cgi file. Works for ActivePerl on Windows machines and Perl5 for Linux machines.
jdante
--------------------
#!/usr/bin/perl
################################################## ########
#
# Copyright 2001, MarketingBots.com, Jacksonville, FL, USA
#
# All rights reserved - Distribute freely but don't change the
# header.
#
# Adds SexSwap's banner to the bottom of pages in a directory
#
# visit http://40til5.com/webmaster - Adult Webmaster Database
#
################################################## ########
#
# Takes a directory of html pages and adds a footer
# to the end of the page while changing the banner number
# so each page has a distinct banner code (ie. no banner caching).
#
# Saves the page page with a new name using a user defined
# prefix. ex. index.html becomes aindex.html
#
# a list of the pages generated is output to a text file.
#
# Tested with Perl5 for Linux types and ActivePerl for Win types.
################################################## ########
#### Modify this stuff as needed
# your sexswap account number
$number = 8800;
# file extension type - .htm works for both .htm and .html
$tag = ".htm";
# starting banner number
$banner = 1;
# this run's output variable added to front of page name
$this = "a";
# list of pages generated
$list = "bannerlist.txt";
# URL location of folder containing file - no trailing '/'
$url = "http://somesite.com/somefolder";
#### Nothing else should need to be changed
#### but you can if you want to. Output html code
#### code goes around the SexSwap code. Don't forget
#### to add a '\' before a quote (") or '@'. (ie \" or \@)
open(LIST,">$list");
opendir(DIR, ".");
foreach $file (readdir(DIR))
{
if($file =~ /$tag/)
{
open(WORK,$file);
$out = $this;
$out .= $file;
open(OUTPUT,">$out");
while(<WORK> ){
print OUTPUT "$_";
}
print OUTPUT "<!---Begin Sex Swap Code--->\n";
print OUTPUT "<CENTER><A HREF = \"http://www.sexswap.com/\">\n";
print OUTPUT "<IMG SRC=\"http://www.sexswap.com/sexswapicon.gif\" WIDTH=\"60\" HEIGHT=\"60\" border=0></A><A\n";
print OUTPUT "HREF = \"http://cgi.sexswap.com/AdSwap.dll?gotoad?accountnumber=$number&PageNumber=$banner\"><IMG\n";
print OUTPUT "SRC=\"http://cgi.sexswap.com/AdSwap.dll?showad?accountnumber=$number&PageNumber=$banner\" WIDTH=\"468\" HEIGHT=\"60\" border=0></A><BR><FONT SIZE=-1><a href =\n";
print OUTPUT "\"http://cgi.sexswap.com/AdSwap.dll?gotoad?accountnumber=$number&PageNumber=$banner\">Please Click On Our Sponsors</A></FONT></CENTER>\n";
print OUTPUT "<!---End Sex Swap Code--->\n";
close (WORK);
close (OUTPUT);
$banner++;
print LIST "$url/$out\n";
}
}
closedir(DIR);
exit;
I do a lot of TG production. There are plenty of programs that make the thumbs and the page html. There are plenty of search and replace programs for modifying multiple TG pages at once. This adds the unique page # for the banner code so you get credit for every page view.
Cut and paste it to a text editor and save it as a .pl or .cgi file. Works for ActivePerl on Windows machines and Perl5 for Linux machines.
jdante
--------------------
#!/usr/bin/perl
################################################## ########
#
# Copyright 2001, MarketingBots.com, Jacksonville, FL, USA
#
# All rights reserved - Distribute freely but don't change the
# header.
#
# Adds SexSwap's banner to the bottom of pages in a directory
#
# visit http://40til5.com/webmaster - Adult Webmaster Database
#
################################################## ########
#
# Takes a directory of html pages and adds a footer
# to the end of the page while changing the banner number
# so each page has a distinct banner code (ie. no banner caching).
#
# Saves the page page with a new name using a user defined
# prefix. ex. index.html becomes aindex.html
#
# a list of the pages generated is output to a text file.
#
# Tested with Perl5 for Linux types and ActivePerl for Win types.
################################################## ########
#### Modify this stuff as needed
# your sexswap account number
$number = 8800;
# file extension type - .htm works for both .htm and .html
$tag = ".htm";
# starting banner number
$banner = 1;
# this run's output variable added to front of page name
$this = "a";
# list of pages generated
$list = "bannerlist.txt";
# URL location of folder containing file - no trailing '/'
$url = "http://somesite.com/somefolder";
#### Nothing else should need to be changed
#### but you can if you want to. Output html code
#### code goes around the SexSwap code. Don't forget
#### to add a '\' before a quote (") or '@'. (ie \" or \@)
open(LIST,">$list");
opendir(DIR, ".");
foreach $file (readdir(DIR))
{
if($file =~ /$tag/)
{
open(WORK,$file);
$out = $this;
$out .= $file;
open(OUTPUT,">$out");
while(<WORK> ){
print OUTPUT "$_";
}
print OUTPUT "<!---Begin Sex Swap Code--->\n";
print OUTPUT "<CENTER><A HREF = \"http://www.sexswap.com/\">\n";
print OUTPUT "<IMG SRC=\"http://www.sexswap.com/sexswapicon.gif\" WIDTH=\"60\" HEIGHT=\"60\" border=0></A><A\n";
print OUTPUT "HREF = \"http://cgi.sexswap.com/AdSwap.dll?gotoad?accountnumber=$number&PageNumber=$banner\"><IMG\n";
print OUTPUT "SRC=\"http://cgi.sexswap.com/AdSwap.dll?showad?accountnumber=$number&PageNumber=$banner\" WIDTH=\"468\" HEIGHT=\"60\" border=0></A><BR><FONT SIZE=-1><a href =\n";
print OUTPUT "\"http://cgi.sexswap.com/AdSwap.dll?gotoad?accountnumber=$number&PageNumber=$banner\">Please Click On Our Sponsors</A></FONT></CENTER>\n";
print OUTPUT "<!---End Sex Swap Code--->\n";
close (WORK);
close (OUTPUT);
$banner++;
print LIST "$url/$out\n";
}
}
closedir(DIR);
exit;