Share
ShareSidebar

Search Engine Position

/************************
SEO Toolkit (c) 2008 TUFaT.com
All Rights Reserved.
Please do not re-distribute or
re-sell this software. Help
us keep these SEO Tools cheap
by not re-selling them.

More info about these tools:
http://www.tufat.com/script214.htm
************************/

ob_start();
session_name(md5(dirname(__FILE__)));
session_start();
$yahooID = "bIpqc43V34G.6UQFQGZVHGYdwJEKr10H9DcBvfFbrB1au6uVZA1jVHkV9wJubMSTjZG9Ma4wpoA-";

function checkImage()
{
if(@$_SESSION['image'])
{
return true;
}
if(@$_POST['image'])
{
if(@$_SESSION['chkimage']==@$_POST['image'])
{
$_SESSION['image'] = true;
}
else
{
$_SESSION['image'] = false;
}

}
//return @$_SESSION['image'];
return true;
}

?>

/************************
SEO Toolkit (c) 2008 TUFaT.com
All Rights Reserved.
Please do not re-distribute or
re-sell this software. Help
us keep these SEO Tools cheap
by not re-selling them.

More info about these tools:
http://www.tufat.com/script214.htm
************************/

function StrToNum($Str, $Check, $Magic)
{
$Int32Unit = 4294967296;

$length = strlen($Str);
for ($i = 0; $i < $length; $i++) {
$Check *= $Magic;
if ($Check >= $Int32Unit) {
$Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit));
$Check = ($Check < -2147483648) ? ($Check + $Int32Unit) : $Check;
}
$Check += ord($Str{$i});
}
return $Check;
}
function HashURL($String)
{
$Check1 = StrToNum($String, 0x1505, 0x21);
$Check2 = StrToNum($String, 0, 0x1003F);

$Check1 >>= 2;
$Check1 = (($Check1 >> 4) & 0×3FFFFC0 ) | ($Check1 & 0×3F);
$Check1 = (($Check1 >> 4) & 0×3FFC00 ) | ($Check1 & 0×3FF);
$Check1 = (($Check1 >> 4) & 0×3C000 ) | ($Check1 & 0×3FFF);

$T1 = (((($Check1 & 0×3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );
$T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );

return ($T1 | $T2);
}
function CheckHash($Hashnum)
{
$CheckByte = 0;
$Flag = 0;

$HashStr = sprintf('%u', $Hashnum) ;
$length = strlen($HashStr);

for ($i = $length - 1; $i >= 0; $i –) {
$Re = $HashStr{$i};
if (1 === ($Flag % 2)) {
$Re += $Re;
$Re = (int)($Re / 10) + ($Re % 10);
}
$CheckByte += $Re;
$Flag ++;
}

$CheckByte %= 10;
if (0 !== $CheckByte) {
$CheckByte = 10 - $CheckByte;
if (1 === ($Flag % 2) ) {
if (1 === ($CheckByte % 2)) {
$CheckByte += 9;
}
$CheckByte >>= 1;
}
}

return ‘7′.$CheckByte.$HashStr;
}

function getpr($url)
{
$ch = CheckHash(HashURL($url));
$content = fetch(”http://www.google.com/search?client=navclient-auto&features=Rank:&q=info:”.urlencode($url).”&ch=$ch”);
preg_match(”#.*?:.*?:(.*?)$#”,$content,$pr);
return @$pr[1] ? $pr[1] : “0″;
}

function getdcpr($url,$dc=”www.google.com”)
{
$ch = CheckHash(HashURL($url));
$content = fetch(”http://$dc/search?client=navclient-auto&features=Rank:&q=info:”.urlencode($url).”&ch=$ch”);
preg_match(”#.*?:.*?:(.*?)$#”,$content,$pr);
return @$pr[1] ? $pr[1] : “Datacenter down”;
}

function getPageRank($url,$dc=”www.google.com”)
{
$ch = CheckHash(HashURL($url));

$fp = @fsockopen($dc, 80, $errno, $errstr, 3);
if (!$fp) {
//echo “$errstr ($errno)
\n”;
return “Datacenter down”;
} else {
$out = “GET /search?client=navclient-auto&ch=” . $ch . “&features=Rank&q=info:” . $url . ” HTTP/1.1\r\n” ;
$out .= “Host: $dc\r\n” ;
$out .= “Connection: Close\r\n\r\n” ;
fwrite($fp, $out);
while (!feof($fp)) {
$data = fgets($fp, 128);
$pos = strpos($data, “Rank_”);
if($pos === false){
}else{
$pagerank = trim(substr($data, $pos + 9));
}
}
fclose($fp);
return (isset($pagerank)?$pagerank : “Datacenter down”);
}
}

function fetch($url)
{
$content = @file_get_contents($url);
/*
$db = DB::getInstance();

// Get cached version of url request
$page = $db->select(”cache”,array(”url”=>$url));

// page found in cache. return file contents from cache, by id from DB
if(@$page[0])
{
$dir = dirname(__FILE__);
$filename = “$dir/../cache/{$page[0]['id']}”;
$content = @file_get_contents($filename);
}
else
{
$insert['time'] = time();
$insert['url'] = $url;
// Save in DB time of request and url, get request id
$id = $db->insert(”cache”,$insert);

$content = @file_get_contents($url);
$dir = dirname(__FILE__);
$filename = “$dir/../cache/$id”;
// Save file in cache
file_put_contents($filename,$content);
}
*/
if (function_exists(’iconv’)) {
if(preg_match(”#)#”,$content,$charset))
{
if(@$charset[1] && strtolower($charset[1])!=”utf-8″)
{
$content = iconv($charset[1],”UTF-8″,$content);
}
}
}
return $content;
}

function getAlexa($dom)
{
if(!$html = @file_get_contents(”http://alexa.com/xml/dad?url=”.$dom)) return ”;

// alexa rank
if (preg_match(’/POPULARITY URL=”[a-z0-9\\-\\.\\/]{1,}” TEXT=”([0-9]{1,12})”/’, $html, $regs))
return (int)$regs[1];

//old is commeted (maybe will be usefull in future)
/*
$dominfo = fetch(”http://www.alexa.com/data/details/main?q=&url=$dom”);
$scramble = @file_get_contents(”http://client.alexa.com/common/css/scramble.css”);
preg_match_all(”#\\.(\\S+)#”,$scramble,$classes);

$dominfo = preg_replace(”#.*?#”,”",$dominfo);
preg_match(”#(.*?)#”,$dominfo,$alexarank);
return strip_tags(@$alexarank[1]);
*/
}

function circle($values=array(”#F4F4F4″,”#ffffff”))
{
static $i;
if($i == count($values))
{
$i = 0;
}
$i++;
return $values[$i-1];
}

?>

/************************
SEO Toolkit (c) 2008 TUFaT.com
All Rights Reserved.
Please do not re-distribute or
re-sell this software. Help
us keep these SEO Tools cheap
by not re-selling them.

More info about these tools:
http://www.tufat.com/script214.htm
************************/

class whois
{
var $_SERVERS = array(
//"com"=>“whois.markmonitor.com”,
//”com”=>”whois.arin.net”,
“com”=>”whois.enom.com”,
“net”=>”whois.crsnic.net”,
“edu”=>”whois.educause.net”,
“org”=>”whois.publicinterestregistry.net”,
“arpa”=>”whois.arin.net”,
“ripe”=>”whois.ripe.net”,
“mil”=>”whois.nic.mil”,
“coop”=>”whois.nic.coop”,
“museum”=>”whois.museum”,
“biz”=>”whois.neulevel.biz”,
“info”=>”whois.afilias.net”,
“name”=>”whois.nic.name”,
“gov”=>”whois.nic.gov”,
“aero”=>”whois.information.aero”,
“ns”=>”whois.internic.net”,
“ip”=>”whois.ripe.net”,
“ad”=>”whois.ripe.net”,
“al”=>”whois.ripe.net”,
“am”=>”whois.ripe.net”,
“as”=>”whois.gdns.net”,
“at”=>”whois.nic.at”,
“au”=>”box2.aunic.net”,
“az”=>”whois.ripe.net”,
“ba”=>”whois.ripe.net”,
“be”=>”whois.dns.be”,
“bg”=>”whois.ripe.net”,
“br”=>”whois.nic.br”,
“by”=>”whois.ripe.net”,
“ca”=>”eider.cira.ca”,
“cc”=>”whois.nic.cc”,
“ch”=>”domex.switch.ch”,
“ck”=>”whois.ck-nic.org.ck”,
“cl”=>”nic.cl”,
“cn”=>”whois.cnnic.net.cn”,
“cx”=>”whois.nic.cx”,
“cy”=>”whois.ripe.net”,
“cz”=>”dc1.eunet.cz”,
“de”=>”whois.denic.de”,
“dk”=>”whois.dk-hostmaster.dk”,
“do”=>”ns.nic.do”,
“dz”=>”whois.ripe.net”,
“ee”=>”whois.ripe.net”,
“eg”=>”whois.ripe.net”,
“es”=>”whois.ripe.net”,
“fi”=>”whois.ripe.net”,
“fo”=>”whois.ripe.net”,
“fr”=>”winter.nic.fr”,
“ga”=>”whois.ripe.net”,
“gb”=>”whois.ripe.net”,
“ge”=>”whois.ripe.net”,
“gl”=>”whois.ripe.net”,
“gm”=>”whois.ripe.net”,
“gr”=>”whois.ripe.net”,
“gs”=>”whois.adamsnames.tc”,
“hk”=>”whois.hkdnr.net.hk”,
“hr”=>”whois.ripe.net”,
“hu”=>”whois.nic.hu”,
“id”=>”muara.idnic.net.id”,
“ie”=>”whois.domainregistry.ie”,
“il”=>”whois.isoc.org.il”,
“in”=>”whois.ncst.ernet.in”,
“is”=>”horus.isnic.is”,
“it”=>”whois.nic.it”,
“jo”=>”whois.ripe.net”,
“jp”=>”whois.nic.ad.jp”,
“kg”=>”whois.domain.kg”,
“kh”=>”whois.nic.net.kh”,
“kr”=>”whois.krnic.net”,
“la”=>”whois.nic.la”,
“li”=>”domex.switch.ch”,
“lk”=>”arisen.nic.lk”,
“lt”=>”ns.litnet.lt”,
“lu”=>”whois.dns.lu”,
“lv”=>”whois.ripe.net”,
“ma”=>”whois.ripe.net”,
“mc”=>”whois.ripe.net”,
“md”=>”whois.ripe.net”,
“mm”=>”whois.nic.mm”,
“ms”=>”whois.adamsnames.tc”,
“mt”=>”whois.ripe.net”,
“mx”=>”whois.nic.mx”,
“nl”=>”whois.domain-registry.nl”,
“no”=>”ask.norid.no”,
“nu”=>”whois.worldnames.net”,
“nz”=>”akl-iis.domainz.net.nz”,
“pl”=>”nazgul.nask.waw.pl”,
“pt”=>”whois.ripe.net”,
“ro”=>”whois.rotld.ro”,
“ru”=>”whois.ripn.net”,
“se”=>”ear.nic-se.se”,
“sg”=>”qs.nic.net.sg”,
“sh”=>”whois.nic.sh”,
“si”=>”whois.arnes.si”,
“sk”=>”whois.ripe.net”,
“sm”=>”whois.ripe.net”,
“st”=>”whois.nic.st”,
“su”=>”whois.ripn.net”,
“tc”=>”whois.adamsnames.tc”,
“tf”=>”whois.adamsnames.tc”,
“th”=>”whois.thnic.net”,
“tj”=>”whois.nic.tj”,
“tn”=>”whois.ripe.net”,
“to”=>”whois.tonic.to”,
“tr”=>”whois.ripe.net”,
“tw”=>”whois.twnic.net”,
“tv”=>”whois.nic.tv”,
“ua”=>”whois.net.ua”,
“uk”=>”whois.nic.uk”,
“us”=>”whois.nic.us”,
“va”=>”whois.ripe.net”,
“vg”=>”whois.adamsnames.tc”,
“ws”=>”whois.worldsite.ws”,
“yu”=>”whois.ripe.net”,
“za”=>”apies.frd.ac.za”,
“xn--p1ag”=>”ru.whois.i-dns.net”,
“xn--p1ag”=>”ru.whois.i-dns.net”,
“xn--j1ae”=>”whois.i-dns.net”,
“xn--e1ap”=>”whois.i-dns.net”,
“xn--c1av”=>”whois.i-dns.net”,
“net.ru”=>”whois.ripn.net”,
“org.ru”=>”whois.ripn.net”,
“pp.ru”=>”whois.ripn.net”,
“spb.ru”=>”whois.relcom.ru”,
“msk.ru”=>”whois.relcom.ru”,
“ru.net”=>”whois.relcom.ru”,
“yes.ru”=>”whois.regtime.net”,
“uk.com”=>”whois.centralnic.com”,
“uk.net”=>”whois.centralnic.com”,
“gb.com”=>”whois.centralnic.com”,
“gb.net”=>”whois.centralnic.com”,
“eu.com”=>”whois.centralnic.com”);

/**
* @return whois
*/
function getInstance()
{
static $instance;
if(!$instance)
{
$instance = new whois();
}

return $instance;
}
function getdomaininfo($domain)
{

preg_match(”#([\\w-]+\\.)+([\\w]+)$#”,$domain,$root);
$domain=$root[1].$root[2];

if (strtoupper(substr(PHP_OS, 0, 5)) === ‘LINUX’) return `whois $domain`;

$domain = strtolower($domain);
preg_match(”#([\\w-]+\\.)+([\\w]+)$#”,$domain,$root);

$server = @$this->_SERVERS[$root[2]] ? $this->_SERVERS[$root[2]] : “whois.arin.net”;
//$server = “whois.markmonitor.com”;
//$server = “whois.enom.com”;

$sock = fsockopen ($server,43,$errno,$errstr);

if (!$sock) {
echo(”$errno($errstr)”);
return;
}
else {
fputs($sock,”$domain\r\n”);
$return = “”;

while (!feof($sock)) {
$return .= fgets ($sock,128);
}
}
fclose ($sock);
return $return;
}
}
$datacenters = array();
$datacenters[] = “72.14.219.104″;
$datacenters[] = “72.14.207.104″;
$datacenters[] = “209.85.133.104″;
$datacenters[] = “64.233.179.104″;
$datacenters[] = “72.14.221.104″;
$datacenters[] = “209.85.129.104″;
$datacenters[] = “72.14.223.104″;
$datacenters[] = “72.14.223.104″;
$datacenters[] = “66.102.1.104″;
$datacenters[] = “64.233.189.104″;
$datacenters[] = “72.14.215.104″;
$datacenters[] = “66.249.91.104″;
$datacenters[] = “72.14.211.104″;
$datacenters[] = “64.233.187.104″;
$datacenters[] = “72.14.209.104″;
$datacenters[] = “64.233.185.104″;
$datacenters[] = “209.85.135.104″;
$datacenters[] = “64.233.183.104″;
$datacenters[] = “64.233.163.104″;
$datacenters[] = “64.233.161.104″;
$datacenters[] = “72.14.253.104″;
$datacenters[] = “209.85.139.104″;
$datacenters[] = “66.249.83.104″;
$datacenters[] = “72.14.205.104″;
$datacenters[] = “64.233.169.104″;
$datacenters[] = “64.233.171.104″;
$datacenters[] = “72.14.203.104″;
$datacenters[] = “72.14.217.104″;
$datacenters[] = “66.249.81.104″;
$datacenters[] = “72.14.255.104″;
$datacenters[] = “209.85.143.104″;
$datacenters[] = “72.14.235.104″;
$datacenters[] = “66.249.93.104″;
$datacenters[] = “64.233.179.104″;
$datacenters = array_values(array_unique($datacenters));
?>

//$searchengines = array(1 => “Google”, 2 => “Yahoo”, 3 => “Live (MSN)”, 4 => “AOL”, 5 => “Altavista”, 6 => “AllTheWeb”);
$searchengines = array(1 => “Google”, 2 => “Yahoo”, 3 => “Live (MSN)”);

$limits = array(100);

?>

Your domain: (eg. yoursite.com)  
Search on: Check All

$searchengines = array(1 => “Google”, 2 => “Yahoo”, 3 => “Live (MSN)”);
echo “
“;
foreach($searchengines as $key => $engine) {
echo “

\n”;
}
echo “

“;

?>

$engine Search
 
Limit search to:
Keywords to search
(one per line):
 

if(strpos(@$_REQUEST['domain'],".")!==false && @$_REQUEST['keywords'] && checkImage() && $_REQUEST['searchengine'] != NULL) {

$domain = $_REQUEST['domain'];
$limit = $_REQUEST['limit'];
$searchenginebox = $_REQUEST['searchengine'];
$keywords = $_REQUEST['keywords'];

$keywords_clean = str_replace("\r","",$keywords);
$keywords_clean = str_replace("\t","",$keywords_clean);
$keywords_clean = trim($keywords_clean);

$keywordsarr = explode("\n",$keywords_clean);

foreach($searchenginebox as $searchengine) {

$rand = rand(1,100000);

foreach($keywordsarr as $keyword) {

if($searchengine == 1) {

$content = file_get_contents("http://www.google.com/search?q=".urlencode($keyword)."&hl=en&num=$limit");
//preg_match_all("#

preg_match_all("#

$place = false;
$url = false;
foreach($urls[1] as $k=>$link)
{
if(preg_match(”#\\w+:/(/.+?\\.|/)$domain/#i”,$link))
{
$url = $link;
$place = $k+1;
break;
}
}
$page = ceil($place / 10);
$from = $page * 10;

# Output

if($place) {

$final[1][$keyword] = “#$place“;

} else {

$final[1][$keyword] = “NO”;

}

} elseif($searchengine == 2) {

$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, “./tmp/cookie”.$rand.”.txt”);
curl_setopt($ch, CURLOPT_URL, “http://search.yahoo.com/search;_ylt=A0geu9gdX8JHkucA_myl87UF?p=”.urlencode($keyword).”&ei=UTF-8&iscqry=&fr=sfp&n=$limit”);
curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);

$content = str_replace(”\n”,”",$content);
$content = str_replace(”\r”,”",$content);
$content = str_replace(”\t”,”",$content);

preg_match_all(”/

.*<\/a><\/h3><\/div>

$place = false;
$url = false;
foreach($urls[1] as $k=>$link)
{
if (strpos ($link, $domain) !==false)
{
$url = $link;
$place = $k+1;
break;
}
}
$page = ceil($place / 10);
$from = (($page * 10)+1)-11;

$url = preg_replace(”/http:\/\/(.*)http%3a\/\//”,”http://”,$url);

# Output

if($place) {

$final[2][$keyword] = “#$place“;

} else {

$final[2][$keyword] = “NO”;

}

} elseif($searchengine == 3)

{
$final[3][$keyword] = “NO”;
for($i = 0; $i < (floor($limit/10) + 1); $i++)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEFILE, "tmp/cookieforlive.txt");
if($i != 0)
{
curl_setopt($ch, CURLOPT_URL, "http://search.live.com/results.aspx?q=".urlencode($keyword)."&first=".$i."1");
} else
{
curl_setopt($ch, CURLOPT_URL, "http://search.live.com/results.aspx?q=".urlencode($keyword));
}
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);

//echo "“;

//preg_match_all(”/

.*<\/a><\/h3>/Usmi”,$content,$urls);
preg_match_all(”/\ \
\

$place = false;
$url = false;
$page = false;
foreach($urls[1] as $k=>$link)
{
if (strpos ($link, $domain) !==false)
// if(preg_match(”#\\w+:/(/.+?\\.|/)$domain/#i”,$link))
{
$url = $link;
$place = ($i*10) + ($k+1);
$page = $i;
break;
}
}
/*
$page = ceil($place / 10);
$from = (($page * 10)+1)-11;
*/
if($page != 0) {
$page = 1;
} else {
$page = ($i*10) - 9;
}
# Output

if($place) {

$final[3][$keyword] = “#$place“;
break;
}
}
}
}

}

echo “

“;

# We open the result table

echo “

“;

# Here’s the search engines columns

foreach($searchenginebox as $searchengine) {

# Here’s our search engine row

echo “

“;

}

echo “

“;

# Here’s the result columns per keyword

foreach($keywordsarr as $keyword) {

# Here’s our keyword

echo “

“;

echo “

“;

foreach($searchenginebox as $key => $searchengine) {

# Here’s our result

//echo “

“;
echo “

“;

}

echo “

“;

}

# We close the result table

echo “

  $searchengines[$searchengine]
"$keyword"
$domain
“.$final[$key+1][$keyword]. “ “.$final[$searchengine][$keyword]. “

“;
} else {
echo ‘

* All fields required.

‘;
}
?>

eXTReMe Tracker