class eb_pop
{

private $domain;
public $google_pr;
public $google_backlink;
public $google_index;
public $alexa_rank;
public $yahoo_backlink;
public $dmoz;
public $bing_index;
public $delicious;


function __construct($domain)
{
$this->domain = $domain;
}

private function sorgu_yap(){

$this->google_pr_sorgu();
$this->google_backlink_sorgu();
$this->google_index_sorgu();
$this->alexa_rank_sorgu();
$this->yahoo_backlink_sorgu();
$this->dmoz_sorgu();
$this->bing_index_sorgu();
$this->delicious_sorgu();
$this->db_ekle();

}

// PAGERANK SORGULAMA

function StrToNum($Str, $Check, $Magic)
{
$Int32Unit = 4294967296; // 2^32

$length = strlen($Str);
for ($i = 0; $i < $length; $i++) {
$Check *= $Magic;
//If the float is beyond the boundaries of integer (usually +/- 2.15e+9 = 2^31),
// the result of converting to integer is undefined
// refer to http://www.php.net/manual/en/language.types.integer.php
if ($Check >= $Int32Unit) {
$Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit));
//if the check less than -2^31
$Check = ($Check < -2147483648) ? ($Check + $Int32Unit) : $Check;
}
$Check += ord($Str{$i});
}
return $Check;
}

function HashURL($String)
{
$Check1 = $this->StrToNum($String, 0x1505, 0x21);
$Check2 = $this->StrToNum($String, 0, 0x1003F);

$Check1 >>= 2;
$Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);
$Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);
$Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);

$T1 = (((($Check1 & 0x3C0) << 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 getpagerank($url) {

$fp = fsockopen("toolbarqueries.google.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)
\n";
} else {
$out = "GET /tbr?client=navclient-auto&ch=".$this->CheckHash($this->HashURL($url))."&features=Rank&q=info:".$url."&num=100&filter=0 HTTP/1.1\r\n";
$out .= "Host: toolbarqueries.google.com\r\n";
$out .= "User-Agent: Mozilla/4.0 (compatible; GoogleToolbar 2.0.114-big; Windows XP 5.1)\r\n";
$out .= "Connection: Close\r\n\r\n";

fwrite($fp, $out);

//$pagerank = substr(fgets($fp, 128), 4);
//echo $pagerank;
while (!feof($fp)) {
$data = fgets($fp, 128);
$pos = strpos($data, "Rank_");
if($pos === false){} else{
$pagerank = substr($data, $pos + 9);
return $pagerank;
}
}
fclose($fp);

}

}

public function google_pr_sorgu()
{
return $this->getpagerank($this->domain);
}

/* Google Backlink Sorgu */


function google_backlink_islem($uri)
{
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=link:'.$uri.'&filter=0';
$v = file_get_contents($url);
preg_match("/
([A-Za-z]+ |)([0-9,]+) result/si",$v,$r);
return ($r[2]) ? $r[2] : '0';
}

public function google_backlink_sorgu()
{
return $this->google_backlink_islem($this->domain);
}

// GOOGLE INDEX

function google_indexed($uri)
{
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=site:'.$uri.'&filter=0';
$v = file_get_contents($url);
preg_match("/
([A-Za-z]+ |)([0-9,]+) result/si",$v,$r);
return ($r[2]) ? $r[2] : '0';
}

public function google_index_sorgu()
{
return $this->google_indexed($this->domain);
}

// ALEXA RANK SORGU


function get_alexa_popularity($url)
{
global $alexa_backlink, $alexa_reach;
$alexaxml = "http://xml.alexa.com/data?cli=10&dat=nsa&url=".$url;

$xml_parser = xml_parser_create();

$data=file_get_contents($alexaxml);
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);

//print_r($vals);
//echo “
//print_r($index);

$index_popularity = $index['POPULARITY'][0];
//echo $index_popularity.”
//print_r($vals[$index_popularity]);
$alexarank = $vals[$index_popularity]['attributes']['TEXT'];

return $alexarank;
}

public function alexa_rank_sorgu()
{
return $this->get_alexa_popularity($this->domain);
}

/* Yahoo Inlink */
function yahoo_inlink($uri)
{
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://siteexplorer.search.yahoo.com/search?p=http://'.$uri.'&bwm=i&bwmo=d&bwmf=u';
$v = file_get_contents($url);
preg_match('/Inlinks \((.*?)\)/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}

public function yahoo_backlink_sorgu()
{
return $this->yahoo_inlink($this->domain);
}

public function yahoo_index_sorgu()
{
$uri = $this->domain;
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://siteexplorer.search.yahoo.com/search?p=http://'.$uri.'&bwm=i&bwmo=d&bwmf=u';
$v = file_get_contents($url);
preg_match('/Pages \((.*?)\)/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}

function bing_sorgu($uri)
{
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://www.bing.com/search?q=site%3Ahttp://'.$uri.'&mkt=en-US';
$v = file_get_contents($url);
preg_match('/of (.*?) /si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}
public function bing_index_sorgu()
{
return $this->bing_sorgu($this->domain);
}

public function alexa_backlink_sorgu() {
$url = "http://www.alexa.com/search?q=".urlencode($this->domain)."&r=site_siteinfo&p=bigtop";
$v = file_get_contents($url);
preg_match('/Sites Linking In: <\/span>([0-9,]+)<\/a>/si',$v,$r);

return ($r[1]) ? $r[1] : '0';
}


}
/* ÖRNEK KULLANIM



*/
?>


şu kodlarda birisi yardım edebilirmi scriptin class dosyası

bing index
google index
google backlink
yahoo backlink
alexa backlink calışmıyor.


çalışan pagerank
alexa trafik rank


şu kodlarda birisi yardım edebilirmi scriptin class dosyası ücretlide yardım alabilirm