Checker ?

iwanov

Registered
Начи направих си това дето изглежда като тарсачка и дето ти проверява Google PR-а (направих го от урока на human).

Искам да попитам как да направя и да ми изкарва другите резултати както в чекера тук.(като Google PR DMOZ Listing Yandex Rank Alexa Traffic Rank Google Indexed Yandex Indexed Google Backlink Yahoo Backlink и MSN Backlink) ?

Искам да попитам и как да направя примерно да дам някакав код на някой и той да го постави в сайта си и там да му показва ПР-а и като цакне на него да му показва всички други резултати които споменах по горе ?

Надявам се някой да ми помогне за тия работи.
 
Код:
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> 
  <link rel="stylesheet" type="text/css" href="http://wthost.net/check.css" media="all" />
<center><div align=center id="container">

<h1>Google Page Rank</h1> 
<form method="POST"> 
Сайт: <input name='url' value='<?=$_REQUEST['url']; ?>' size="20"><input type="submit" value="Покажи"> 
</form> 
<hr> 
<? 

$website = $_REQUEST['url']; 
if( $website ){ 
    if( !strstr($website,"http://") && !strstr($website,"https://") ){ 
        $website = "http://".$website; 
    } 
    $linkedpages = linkcheck($website,'google'); 
    $indexedpages = GoogleLinks($website); 
     
    $pr = GooglePageRank($website); 
    $indexed = $indexedpages[google][0]; 
    $links = $linkedpages[google][0]; 

    $data = array(); 
    $target = trim(eregi_replace('http://', '', $website)); 
    // checking Google 
    $source = 'http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=link%3A'.$target; 
    $data['Google'] = array(fetch($source, 'of about', 9, 'linking', 'did not match any documents'), $source); 
    // checking Yahoo! 
    $source = 'http://search.yahoo.com/search?p=linkdomain%3A'.$target.'&sm=Yahoo%21+Search&fr=FP-tab-web-t&toggle=1'; 
    $data['Yahoo!'] = array(fetch($source, 'of about', 9, 'for', "we didn't find any web pages"), $source); 
    // checking AlltheWeb 
    $source = 'http://www.alltheweb.com/search?cat=web&cs=utf8&q=link%3A'.$target.'&rys=0&_sb_lang=pref'; 
    $data['AlltheWeb'] = array(fetch($source, 'audio1 -', 14, 'results', "no web pagesfound that match your query"), $source); 
    // checking AltaVista 
    $source = 'http://www.altavista.com/web/results?itag=wrx&q=linkdomain%3A'.$target.'&kgs=1&kls=0'; 
    $data['AltaVista'] = array(fetch($source, 'altavista found', 15, 'results', "we found 0 results"), $source); 

?> 
    <table width='400' border='0' align="center" cellpadding='5' cellspacing='0' bgcolor="#EDF4FC"> 
        <tr> 
            
        <td align='left' colspan='2'><b>Google информация</b></td> 
        </tr> 
        <tr> 
            <td><strong>Сайт</strong></td><td><a href="<?=$website?>"><?=$website?></a></td> 
        </tr> 
        <tr> 
            <td><strong>Ранк</strong></td><td><img src=pr<?=$pr?>.gif></td> 
        </tr> 
        <tr> 
            <td><strong>Индексирани страници</strong></td><td><a href="<?=$indexedpages[google][1]?>"><?=$indexed?></a></td> 
        </tr> 
        <tr> 
            <td><strong>Линкове</strong></td><td><a href="<?=$linkedpages[google][1]?>"><?=$links?></a></td> 
        </tr> 
    
        <tr> 
            <td align='center' colspan='2'><h2>Популярност в търсачките:</h2></td> 
        </tr> 
        <tr> 
            <td><strong>Търсачки</strong></td><td align='right'><strong>Линкове</strong></td> 
        </tr> 
        <? 
        foreach($data as $engine => $result) { 
        ?> 
        <tr> 
            <td><a href='<? echo $result[1]; ?>' target='_blank'><? echo $engine; ?></a></td> 
            <td align='right'> 
            <? 
            if($result[0]) 
                echo $result[0]; 
            else 
                echo 'Yok'; 
            ?> 
            </td> 
        </tr> 
        <? 
        $total += ereg_replace("[[:punct:]]", '', $result[0]); 
        } 
        ?> 
        <tr> 
            <td><strong>Общо</strong></td> 
            <td align='right'><strong><? echo $total; ?></strong></td> 
        </tr> 
    </table> </div>
</center> 
<? 
} 

function fetch($source, $start, $smlen, $stop, $fail) { 
    $data = @implode('', @file($source)); 
    $data = strip_tags($data); 
    $data = strtolower($data); 
    $data = str_replace("\n", '', $data); 
    $data = str_replace("\r", '', $data); 
     
    if(substr_count($data, $fail)) { 
        return 0; 
    } else { 
        $data = substr($data, strpos($data, $start)+$smlen); 
        $data = substr($data, 0, strpos($data, $stop)); 
        return trim($data); 
    } 
} 

function linkcheck($url, $engine) { 
    global $total; 
    $arr = parse_url($url); 
    $url = $arr['host']; 
    $path = "http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=link%3A".$url; 
    if(!file_exists($path)) { 
        $data = strtolower(strip_tags(implode("", file($path)))); 
        $data = substr($data, strpos($data, "of about")+9, strlen($data)); 
        $data = substr($data, 0, strpos($data, " ")); 
        if(eregi("[[:alpha:]]", $data)) { 
            $results[$engine] = array('0', $path); 
        } else { 
            $results[$engine] = array($data, $path); 
            $total+=str_replace(',', '', $data); 
        } 
    } else { 
        $results[$engine] = array('n/a', $path); 
    } 
    return $results; 
} 
function GoogleLinks($url){ 
    $arr = parse_url($url); 
    $url = $arr['host']; 
    $engine = 'google'; 
    $path = 'http://www.google.com/search?q=inurl:'.$url.'&hl=en&lr=&ie=UTF-8&filter=0'; 
    if(!file_exists($path)) { 
        $data = str_replace(' ', ' ', strtolower(strip_tags(@implode('', @file($path))))); 
        if(!strpos($data, 'did not match any documents')) { 
            $data = substr($data, strpos($data, 'web results')+12, strlen($data)); 
            $data = trim(substr($data, 0, strpos($data, 'for'))); //echo $data; // TEST 
            $data = explode(' ', $data); 
            $data = $data[(count($data)-1)]; 
            $results[$engine] = array($data, $path); 
            $total+=str_replace(',', '', $data); 
        } else { 
            $results[$engine] = array('0', $path); 
        } 
    } else { 
        $results[$engine] = array('n/a', $path); 
    } 
    return $results; 
} 

function GooglePageRank($url){ 
    $arr = parse_url($url); 
    $url = $arr['host']; 
    $url="info:".$url; $ch=GoogleCSum($url,0xE6359A60); 
    $host="toolbarqueries.google.com"; $hostip=gethostbyname($host); 
    $query ="GET /search?client=navclient-auto&ch=6".$ch."&ie=UTF-8&oe=UTF-8&features=Rank&q=".rawurlencode($url)." HTTP/1.0\r\n"; 
    $query.="Host: $host\r\n"; $rank=-1; 
    $query.="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n"; 
    $query.="Connection: Close\r\n\r\n"; 
    $fp=fsockopen($hostip,80,$errno,$errstr,30); 
    if ($fp) 
    { fputs($fp,$query); $data=""; while (!feof($fp)) $data.=fgets($fp,4096); fclose($fp); 
    $data=explode("\n",$data); 
    foreach ($data as $line) 
    if (!is_bool(strpos($line,"Rank_1"))) 
    { $rank=explode(":",trim($line)); $rank=$rank[2]; break; } } 
    return $rank; 
} 

function GoogleCSum($s,$key){ 
    $v4=$len=strlen($s); $esi=$key; $ebx=$edi=0x9E3779B9; $p=0; 
    if ($len>=12) 
    for($i=0;$i<floor($len/12);$i++) 
    { $edi=unsign($edi+ord($s[$p+4])+(ord($s[$p+5]) << 8)+(ord($s[$p+6]) << 16)+(ord($s[$p+7]) << 24)); 
    $esi=unsign($esi+ord($s[$p+8])+(ord($s[$p+9]) << 8)+(ord($s[$p+10]) << 16)+(ord($s[$p+11]) << 24)); 
    $edx=unsign(($ebx+ord($s[$p+0])+(ord($s[$p+1]) << 8)+(ord($s[$p+2]) << 16)+(ord($s[$p+3]) << 24)-$edi-$esi)^shr($esi,13)); 
    $edi=unsign(($edi-$esi-$edx)^($edx << 8)); 
    $esi=unsign(($esi-$edx-$edi)^shr($edi,13)); 
    $edx=unsign(($edx-$edi-$esi)^shr($esi,12)); 
    $edi=unsign(($edi-$esi-$edx)^($edx << 16)); 
    $esi=unsign(($esi-$edx-$edi)^shr($edi,5)); 
    $edx=unsign(($edx-$edi-$esi)^shr($esi,3)); $ebx=$edx; 
    $edi=unsign(($edi-$esi-$ebx)^($ebx << 10)); 
    $esi=unsign(($esi-$ebx-$edi)^shr($edi,15)); 
    $v4-=12; $p+=12; } 
    $esi=unsign($esi+$len); 
    if ($v4>=11) $esi=unsign($esi+(ord($s[$p+10]) << 24)); 
    if ($v4>=10) $esi=unsign($esi+(ord($s[$p+9]) << 16)); 
    if ($v4>=9) $esi=unsign($esi+(ord($s[$p+8]) << 8)); 
    if ($v4>=8) $edi=unsign($edi+ord($s[$p+4])+(ord($s[$p+5]) << 8)+(ord($s[$p+6]) << 16)+(ord($s[$p+7]) << 24)); 
    else 
    { if ($v4>=7) $edi=unsign($edi+(ord($s[$p+6]) << 16)); 
    if ($v4>=6) $edi=unsign($edi+(ord($s[$p+5]) << 8)); 
    if ($v4>=5) $edi=unsign($edi+ord($s[$p+4])); } 
    if ($v4>=4) $ebx=unsign($ebx+ord($s[$p+0])+(ord($s[$p+1]) << 8)+(ord($s[$p+2]) << 16)+(ord($s[$p+3]) << 24)); 
    else 
    { if ($v4>=3) $ebx=unsign($ebx+(ord($s[$p+2]) << 16)); 
    if ($v4>=2) $ebx=unsign($ebx+(ord($s[$p+1]) << 8)); 
    if ($v4>=1) $ebx=unsign($ebx+ord($s[$p+0])); } 
    $ebx=unsign(($ebx-$edi-$esi)^shr($esi,13)); 
    $edi=unsign(($edi-$esi-$ebx)^($ebx << 8)); 
    $esi=unsign(($esi-$ebx-$edi)^shr($edi,13)); 
    $ebx=unsign(($ebx-$edi-$esi)^shr($esi,12)); 
    $edi=unsign(($edi-$esi-$ebx)^($ebx << 16)); 
    $esi=unsign(($esi-$ebx-$edi)^shr($edi,5)); 
    $ebx=unsign(($ebx-$edi-$esi)^shr($esi,3)); 
    $edi=unsign(($edi-$esi-$ebx)^($ebx << 10)); 
    $esi=unsign(($esi-$ebx-$edi)^shr($edi,15)); return $esi; 
} 
function shr($x,$y) { 
    $x=unsign($x); 
    for($i=0;$i<$y;$i++) $x=floor($x/2); return $x; 
} 
function unsign($l) { 
    $l=intval($l); 
    if ($l>=0){ 
        return $l; 
    }else{ 
        return 4294967296+$l; 
    } 
} 
?>



Demo
 
10x human за кода
Някой ако има *.css файла споменат в началото на кода ще съм му много благодарен.
И също не ми е ясно как да стане това - втория ми въпрос от първия ми пост.
Мерси предварително.
 
@admin помогни малко плс знам че го знйш това как става се пак си го правил и ти. :)
Сподели опита си.
 
check.css

Код:
 body {
	background-color: #ffffff;
        margin: 10;
		}



input {
	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 10px;
	text-decoration: none;
    background-color: #EDF4FC;
    font-weight : bold;

}
textarea {
	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 10px;
	text-decoration: none;
	background-color: #EDF4FC;
    font-weight : bold;
}
select {
	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 10px;
	text-decoration: none;
	background-color: #EDF4FC;
    font-weight : bold;
}
select.poll {
	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 10px;
	text-decoration: none;
     font-weight : bold;
}

td.bg1{
background-image: url(images/bg1.gif);
font-size: 12px;
font-weight : bold;
font-family:verdana,Tahoma;
color:#1A3C63;
} 
td.bg2{
background-image: url(images/bg2.gif);
font-size: 12px;
font-weight : bold;
font-family:verdana,Tahoma;
color:#1A3C63;
border-bottom: 1px solid #CCC;
}

.info {
font-size: 9px;
font-family:verdana,Tahoma;
color:#494D53;
font-weight : bold;
}




.default{
font-family:Verdana;
font-size: 11px;
}
.bg{
font-family:Verdana;
font-size: 12px;
}

table.backg1{
border: 1px solid  #7DA1CA;
}   
table.backg2{
border-left: 1px solid  #7DA1CA;
border-right: 1px solid  #7DA1CA;
border-bottom: 1px solid  #7DA1CA;
}   
table.backg3{
border: 1px  solid  #7DA1CA;
}   


#nav {
font-size: 12px;
font-family:verdana,Tahoma;
color:#1A3C63;
padding-left: 0px;
background-color:#CEDDFA;
font-weight : bold;
border-right: 1px solid #CCC;
	}
	
	
#nav ul {
	list-style-type: none;
	margin-bottom: 0px;
	}
	

#nav a {
	display: block;
	font-size: 12px;
	font-weight: bold;
	color: #363A67;
    font-family:Verdana; 
	text-decoration: none;
	margin: 0 4px auto 4px;
	padding-left: 0px;
	height: 12px;
	padding-top: 0px;
	}

#nav a:hover {
color:#17222F;

	}

.nava {
font-size: 12px;
font-family:verdana,Tahoma;
color:#1A3C63;
padding-left: 0px;
background-color:#CEDDFA;
font-weight : bold;
border-right: 1px solid #CCC;
text-decoration: none;
	}
	
	
.nava ul {
	list-style-type: none;
	margin-bottom: 0px;
	}
	

.nava a {
	display: block;
	font-size: 12px;
	font-weight: bold;
	color: #363A67;
    font-family:Verdana; 
	text-decoration: none;
	margin: 0 4px auto 4px;
	padding-left: 0px;
	height: 12px;
	padding-top: 0px;
	}

.nava a:hover {
color:#17222F;
text-decoration: none;

	}



.left {
font-size: 12px;
background-color:#EDF4FC;
font-family:verdana,Tahoma;
}
.center {
font-size: 11px;
font-family:verdana,Tahoma;
color:#494D53;
border: 1px  solid  #7DA1CA;
}
.center2 {
font-size: 11px;
font-family:verdana,Tahoma;
color:#494D53;
}

.st {
font-size: 11px;
font-family:verdana,Tahoma;
color:#494D53;
}
.mini {
font-size: 9px;
font-family:verdana,Tahoma;
color:#494D53;
font-weight : bold;
}



.webagent {
font-size: 10px;
font-family:verdana,Tahoma;
color:#494D53;
font-weight : bold;
border-right: 1px  solid  #7DA1CA;
}


table.kontakti{
font-family: Tahoma, Verdana, Arial, Sans-Serif; 
font-size: 11px;
text-align: left;
color: #193B62; 
border: 1px solid #7DA1CA;
font-weight : bold;
color:#374555;
background-color:#B2C4D7;


}



a.menu:link{text-decoration: none; color: #11529D;}
a.menu:visited{text-decoration: none;color:#11529D;}
a.menu:active {text-decoration: none;color: #7DA1CA;}
a.menu:hover {text-decoration: none; color: #7DA1CA;}

.webagentlink:link{text-decoration: none; color:#363A67;font-weight : bold;}

.sivo {
font-size: 12px;
background-color:#F5F5F5;
font-family:verdana,Tahoma;
}
.bgpingvin
{
background: url(images/bgpingvin.jpg) no-repeat right;
font-size: 12px;
font-family:verdana;
}
.u {
font-size: 11px;
font-family:verdana,Tahoma;
color:#494D53;
border-top: 1px dotted #CCC;

}
table.tablebig {
font-size: 11px;
font-family:verdana,Tahoma;
color:#494D53;
border: 1px  solid  #7DA1CA;
}
table.tb {
font-size: 12px;
font-family:verdana,Tahoma;
color:#494D53;
border-bottom: 1px solid #7DA1CA;
}



table.table {
       font-size: 12px; 
        width:600px;
	border-width:1px;
        border-spacing:0px;
	border-style: outset;
	border-color:#7DA1CA;
	border-collapse: separate;
	background-color: #EDF4FC;
    

       
}

#dropmenudiv{
position:absolute;
background-color: #CEDDFA;
border:1px solid #EDF4FC;
border-bottom-width: 0;
font:normal 11px Verdana;
line-height:25px;
z-index:100;
}

#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border: 1px solid #EDF4FC;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
}

#dropmenudiv a:hover{
background-color: #CEDDFA;
}


.navlist li {
list-style-type: square;
width: 135px;
background-color: #CEDDFA;
}
.fon3
{  
/*background-image: url(http://web-tourist.net/images/fon3.gif);background-repeat: no-repeat;*/
background-color:#E5EDF6;
border: 1px  solid  #C9DAEE;
font:normal 11px tahoma,Verdana;

}
.search {
font-size: 11px;
font-family:verdana,Tahoma;
color:#494D53;
}
#dhtmltooltip{
position: absolute;
width: 150px;
border: 2px solid #EDF4FC;
padding: 2px;
background-color: #ffffff;
visibility: hidden;
z-index: 100;
font-size: 10px;
font-family:verdana,Tahoma;
color:#494D53;
}
 
@jooorooo 10х за кода

Другия ми въпрос е като на asteryx :
asteryx каза:
А как ще стане да дава код на всеки който иска да го ползва като на WT
 

Back
Горе