• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

Test parking companies...

Status
Not open for further replies.
Joined
Dec 4, 2006
Posts
30
Reaction score
1
Hi all,

I try to write a script to test which parking companies will pay more.

The script should work like this:

- if a domain gets a type in it will redirect to parking company "1"
- the next type in will redirect to parking company "2"
- ...

On the end of the day I can compare the clicks, payouts,...

Does anybody have already a tool like this? Is anybody interested in it?

greetings from Austria
Sebastian
 
Hi, this isn't quite what you're after but is close and should be easy enough to modify. Please no laughter, it was the very first PHP I wrote.

What this script does is create a logfile per domain that I could feed into a logfile analysis tool like webalizer then randomly redirects to trafficz or namedrive with a few domains shunted off to 1plus

I wrote it about 2 years back and used it for a few weeks while I did some analysis. It's not very robust, but I only intended it for short term use and was happy to monitor it fairly closely.

Depending on how your server is set up you'll need to change the log file address in the line reading
Code:
$logFile = $_SERVER["DOCUMENT_ROOT"] . "/../mylogs/".$domain."-".date("Ym").".log";

Bruce

Code:
<?php
// Copyright (C) 2006 Bruce Clement
// You may use this under the terms of the GPL version 3
$startServer = $_SERVER["SERVER_NAME"];
if ($startServer=="") {$startServer =$_SERVER["HTTP_HOST"];}
$namedrive="http://www.ndparking.com/";
$trafficz="http://landing.trafficz.com/index.php?domain=";
$oneplus="http://www.1plus.net/";
srand( ((int)((double)microtime()*1000003)) );
$sel=rand( 0,1);
switch( $sel )
{
    case 0:
	$target=$oneplus;
	break;
    default:
	$target=$namedrive;
	break;
}
$domain=str_replace("www.","",strtolower($startServer));
$targe2="$domain";
$targe3="";
if (stristr($domain,"school.nz")) {$target=$namedrive;}
if (stristr($domain,".ac.nz")) {$target=$oneplus;}
if (stristr($domain,".gen.nz")) {$target=$oneplus;}
switch( $domain ) {
    case "DOMAIN1.co.nz":
        $target=$namedrive;
       break;
    case "DOMAIN2.co.nz":
        $target=$trafficz;
       break;
    default:
	break;
}
if( $target==$trafficz ) {$target = $namedrive;}
if( $target==$oneplus  ) {$targe3 = "/";}
if (!stristr($domain,"Where-the-script-is.com"))
{
	$host=$_SERVER['REMOTE_ADDR'];
	$ident=$_SERVER['REMOTE_IDENT'];
	$auth=$_SERVER['REMOTE_USER'];
	$timeStamp=date("d/M/Y:H:i:s O");
	$reqType=$_SERVER['REQUEST_METHOD'];
	$servProtocol=$_SERVER['SERVER_PROTOCOL'];
	$userAgent=$_SERVER['HTTP_USER_AGENT'];
	$referrer=$_SERVER['HTTP_REFERER'];
	$fileName=$_SERVER['REQUEST_URI'];
	$fileSize="92";
	$statusCode="200";
	if ($host==""){ $host="-"; }
	if ($ident==""){ $ident="-"; }
	if ($auth==""){ $auth="-"; }
	if ($reqType==""){ $reqType="-"; }
	if ($servProtocol==""){ $servProtocol="-"; }
	if ($userAgent==""){ $userAgent="-"; }
	if ($referrer==""){ $referrer="-"; }
	if ($fileName=="" || stristr($userAgent,"gigablast")){ $fileName="/"; }
	// Create CLF formatted string
	$clfString=$host." ".$ident." ".$auth." [".$timeStamp."] \"".$reqType." ".$fileName." ".$servProtocol."\" ".$statusCode." ".$fileSize." \"".$referrer."\" \"".$userAgent."\"\n";
	if( $host != "223.132.212.226" )
	{
		$logFile = $_SERVER["DOCUMENT_ROOT"] . "/../mylogs/".$domain."-".date("Ym").".log";
		if (file_exists($logFile)){
			// If YES, Open Existing Log File
			$fileWrite = fopen($logFile,"a");}
		else {
			// If NO, Create a New Log File
			$fileWrite = fopen($logFile,"w");
		}
		flock($fileWrite, LOCK_SH);
		fwrite($fileWrite,$clfString);
		flock($fileWrite, LOCK_UN);
		fclose($fileWrite);
		if( 1 ) {
			$log2=$_SERVER["DOCUMENT_ROOT"] . "/../mylogs/info.txt";
			if (file_exists($log2)){
				// If YES, Open Existing Log File
				$file2 = fopen($log2,"a");
			} else {
				$file2 = fopen($log2,"w");
			}
			flock($file2, LOCK_SH);
			$clfString = $target . $targe2 . $targe3 . "\n";
			fwrite($file2, $clfString );
			flock($file2, LOCK_UN);
			fclose($file2);
		}
	}
	header("HTTP/1.1 302 Found");
	header("Location: $target$targe2$targe3");
	exit();
}
?>
<html>
<body>
<?php
echo "startServer: " . $startServer . "<br />";
echo "target: " . $target . "<br />";
echo "targe2: " . $targe2 . "<br />";
echo "Host: " . $_SERVER["HTTP_HOST"] . "<br />";
echo "Server Name: " . $_SERVER["SERVER_NAME"] . "<br />";
echo "Request uri: " . $_SERVER["REQUEST_URI"] . "<br />";
echo "Referer: " . $_SERVER["HTTP_REFERER"] . "<br />";
echo "Script Name: " . $_SERVER["SCRIPT_NAME"] . "<br />";
echo "Query String: " . $_SERVER["QUERY_STRING"] . "<br />";
echo "Browser: " . $_SERVER["HTTP_USER_AGENT"] . "<br />";
echo "User's IP address: " . $_SERVER["REMOTE_ADDR"] . " " . $_SERVER["HTTP_X_FORWARDED_FOR"] . "<br />";
?>
</body>
</html>
 
Thank you for your code. Did you already get any "usefull" statistic information - or is the time period to short to say anything?

best
Sebastian
 
Did you already get any "usefull" statistic information - or is the time period to short to say anything?
This is all from 2 years ago & I only ran it in that form for a short while but I got a good understanding of the traffic on many of my domains.

Unfortunately almost none of the domains I had back then really were traffic domains & most of the so-called traffic was things like hotlinks to images (These were mostly expired domains I'd caught in drops).

For reasons I never understood my revenue dropped while I was using it so I only ever used it on domains with low CTR & RPM to try and understand the why.
 
Status
Not open for further replies.
Top Bottom