PDA

View Full Version : Link skimming script?


Abbadon
04-03-2001, 12:06 PM
Does anyone have a source for a simple link skimming script? ie: something you can hand a gallery link and have it skim a percentage to an outscript instead? It doesn't matter to me if the outscript url and percentage have to be hardcoded or passed in from the url. Alternatively, a client-side javascript routine to do the same would be fine.

Just lazy today and figured somebody had to have written this a million times, so thought I'd ask before I built my own...

Thanks

Zane
04-03-2001, 12:46 PM
I'd be interested in this type of script, too.

Ride
04-03-2001, 01:12 PM
It is inlcuded in the UCJ IV script, and I think Scorpion2 now has an add on that does some same thing.

Ride

Zane
04-03-2001, 01:16 PM
I am interested in a skimming script that I could use on my non-cj sites, thanks tho Ride

Abbadon
04-03-2001, 02:22 PM
Thanks Ride; I know S2 has one, and had surmised that UCJ IV did... Was just looking for something generic that could be used with CJPro or whatever else. It's a pretty trivial script, I just didn't want to spend all afternoon brushing up on my rusty perl to write it :-)

XP
04-04-2001, 01:27 AM
Writing this kinda script is very easy for me. Contact me if you want any http://bbs.adultwebmasterinfo.com/ubb/smile.gif
(Free of Charge)
ICQ: 171040

Abbadon
04-06-2001, 01:35 PM
Okay, I broke down and wrote one. Anyone elsw who was wanting it can feel free to use it and abuse it - it seems to work, although I'm sure its far from elegant.

Here it is:

#!/usr/bin/perl
# Simpleminded Link Skimming Script
# Will send a percentage of hits to your outscript
# (or wherever else you want) and the rest to the gallery
# (or whatever it happens to be linked to)
# =====Instructions=====
# Put this script somewhere that cgi can be executed. chmod it to be executable.
# Set $outscript to the location of your outscript
# Set $skim to the percentage of clicks you want sent to your outscript
# Link to it as <a href="ls.cgi?URL=http://www.somegalleryhere.com/gallery.html">Gallery</a>
# Suck up them clicks.
# This is released into the public domain
# The author makes no warrenties as to its fitness for any given use or its safety or
# accuracy -- the author basicly doesn't even write perl.
# Completely unsupported. You break it, you own both pieces.
$outscript="http://www.myskankyassedcj.com/cjpro/cjproout.cgi";
$skim = int(30);
&parse_query;
srand();
$luck = int(rand(99))+1;
if ($luck < $skim) {
print "Location: $outscript \n\n";
}
else {
print "Location: $query{'URL'} \n\n";
}

sub parse_query {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ s/~/=/g;
$query{$name} = $value;
}
}