Google PageRank查询,批量查询,鉴别真假

$q=trim($_GET['q']);
$sd=(int)trim($_GET['sd']);
$t=(int)trim($_GET['t']);
if(strstr($q, " ")){
 $isulist=1;
 $ulist=explode(" ",$q);
 for($i=0;$i<count($ulist);$i++){
  $domain='';
  $domain=matchdomain($ulist[$i]);
  if($domain<>''){
   $q2.=$domain." ";
  }
 }
 $ulist=explode(" ",$q2);
}else{
$q2=matchdomain($q);
}

<div  class=contentbox>
<div class="content_nav"><span class="tt">Google PageRank查询</span></div>
<div class=toolitem>
<br><form action="" method="get">
<table style="vertical-align:middle;"><tr><td>
域名:</td><td><textarea rows="5" cols="40" style="border: 1px solid rgb(126, 157, 185); background-color: white;" id="query"  name="q" autocomplete="off" type="text">
<?php教程
if($q2<>""){
 echo $q2;
}else{
echo "www.111cn.net tool.111cn.net down.111cn.net baidu.com google.com";
}
?>
</textarea>
</td><td>
<input type="checkbox" name="sd" value="1"
<?php if($sd==1){ echo 'checked="checked"';} ?>
/> 查询二级域名PR
<br><input type="checkbox" name="t" value="1"
<?php if($t==1){ echo 'checked="checked"';} ?>
/> 鉴别真假
</td><td>
 <span class="backgroundbord"><button class="srh_onesearch" type="submit">查      询</button></span>
</td></table>
</form>
</div>
</div>
<?php
require_once '../ad/mid.php';
if($q2==''){
?>
<div class=contentbox>
<div class="content_nav"><span class="tt">工具说明</span></div>
<div class=topmenuitem>
<p>请输入域名,如chaxun.la。<br>多域名查询请每行输入一个域名,域名没有个数限制!<br><font color=red>查询二级域名PR:</font>将查询该域名的二级域名的PR。(二级域名通过查询本站数据库教程获得,并不全面!)<br><font color=red>鉴别真假:</font>将鉴别该域名的PR是否是劫持其它网站的PR。</p>
</div>
</div>

<?php
}else{
 echo "<div class=contentbox>";
 echo '<div class="content_nav"><span class="tt">查询结果</span></div>';
 echo "<div class=topmenuitem>";
   echo '<span style="width=200px;text-align:right;padding-right:50px;">域名</span><span class="span_iframe">PR</span>';
   if($t){ echo '<span class="span_iframe_pr">鉴别真假</span>';}
   echo '<br>';
 if($isulist){
  for($jj=0;$jj<count($ulist)-1;$jj++){
  $ch=get_pagerank('http://'.$ulist[$jj]);
   echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$ulist[$jj].'"><font color=red>'.$ulist[$jj].'</font></a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$ulist[$jj].'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
   if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$ulist[$jj].'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
   echo '<br>';
   if($sd){
   //从数据库读取此域名的二级域名
    $topdomain=topdomain($ulist[$jj]);
    $sql="select domain from c_domainlist where topdomain='$topdomain' and domain<>'$ulist[$jj]' order by domain";
    $result=mysql教程_query($sql);
    //or die(mysql_error());
    while($row=mysql_fetch_array($result)){
     $ch=get_pagerank('http://'.$row['domain']);
    echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$row['domain'].'">'.$row['domain'].'</a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$row['domain'].'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
    if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$row['domain'].'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
    echo '<br>';
    }
   }
  }
 }else{
   $ch=get_pagerank('http://'.$q2);
   echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$q2.'"><font color=red>'.$q2.'</font></a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$q2.'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
   if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$q2.'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
    echo '<br>';
   if($sd){
   //从数据库读取此域名的二级域名
    $topdomain=topdomain($q2);
    $sql="select domain from c_domainlist where topdomain='$topdomain' and domain<>'$q2' order by domain";
    $result=mysql_query($sql);
    //or die(mysql_error());
    while($row=mysql_fetch_array($result)){
     $ch=get_pagerank('http://'.$row['domain']);
    echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$row['domain'].'">'.$row['domain'].'</a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$row['domain'].'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
    if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$row['domain'].'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
    echo '<br>';
    }
   }
  }
echo "</div></div>";
}
function get_pagerank($permalink){
 $gpr = new PageRank();
 return $gpr->ch("$permalink");
}

class PageRank{
// 7/25/2008 - Updated by Askie (http://www.pkphp.com/)
// 3/20/2008 - Updated by Roger Collins (http://www.rogercollins.com/)
// to remove graphing step

//PageRank Lookup v1.1 by HM2K (update: 31/01/07)
//based on an alogoritham found here: http://pagerank.gamesaga.net/

 //settings - host and user agent
 var $googlehost='toolbarqueries.google.com';
 var $googleua='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5';

 //convert a string to a 32-bit integer
 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;
 }

 //genearate a hash for a url
 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);
 }

 //genearate a checksum for the hash string
 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;
 }

 //return the pagerank checksum hash
 function getch($url) { return $this->CheckHash($this->HashURL($url)); }

 //return the pagerank figure
 function ch($url){
  $urlinfo=parse_url($url);
     $start=$urlinfo["scheme"]<>""?strlen($urlinfo["scheme"]."://"):0;
  $url=substr($url,$start);
  
  $pr = 0;    // default return
     $ch = $this->getch($url);
  return $ch;
 }
}

$q=trim($_GET['q']);
//for($i=0;$i<5;$i++){
$pagecode = @file_get_contents("http://www.google.cn/search?q=info:".$q);
 //   if($pagecode){
// break;
// }
//}
    if($pagecode){
  preg_match('/<cite>(.*?)//', $pagecode, $googlepr);
  if($q==$googlepr[1] or strstr($googlepr[1], '.'.$q) or strstr($q, '.'.$googlepr[1])){
   echo '<font style="color:green;font-weight:bold;">√</font>';
  }elseif($q<>$googlepr[1] and $googlepr[1]<>''){
   echo '<font style="color:red;font-weight:bold;">×</font>,此网站可能劫持'.$googlepr[1].'的PR!';
  }elseif($googlepr[1]==''){
   echo '在Google搜索info:'.$q.'无信息!';
  }
 }else{
 echo "获取Google信息失败!"; 
 }

时间: 2024-08-01 23:07:18

Google PageRank查询,批量查询,鉴别真假的相关文章

PHP批量查询WordPress留言者E-mail地址实现方法

 这篇文章主要介绍了PHP批量查询WordPress留言者E-mail地址实现方法,本文直接给出实现代码,需要的朋友可以参考下     今天收到了很多Bloger朋友的E-mail拜年短信,嘿嘿,感觉很好玩,可是他们是如何实现的这个呢,很简单的,可是简单的分为两步: 1)通过SQL查询获取E-mail地址 2)通过某种方法群发E-mail 对于1,几行PHP代码可以解决: 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transiti

如何批量查询PR值、百度权重、百度快照及收录量

批量查询数据是我们经常需要用到的,但是目前没有一个网站提供了这样的查询功能.如果我们要购买一批网站的外链的时候,查询这样的数据更具迫切性.那么到底有没有网站能批量地查询到这些数据呢?个人发现了一个,在这里分享给大家. 第一步,大家打开爱站网,里面有个友链检查.   第二步,点开手动输入友情链接网址   第三步,把要查询的网址列表输入到输入框里   点击查询即可.我们可以把对方回链不要选中,然后只查询这些站点的PR值,百度收录.快照.权重等信息.这样就能达到批量查询的效果了.这个本来是查询是否有回

MySQL分表实现上百万上千万记录分布存储的批量查询设计模式

我们知道可以将一个海量记录的 MySQL 大表根据主键.时间字段,条件字段等分成若干个表甚至保存在若干服务器中. 唯一的问题就是跨服务器批量查询麻烦,只能通过应用程序来解决.谈谈在Java中的解决思路.其他语言原理类似. 这里说的分表不是 MySQL 5.1 的 partition,而是人为把一个表分开存在若干表或不同的服务器. 1. 应用程序级别实现 见示意图 SelectThreadManager 分表数据查询管理器 它为分表的每个database or server 建立一个 thread

php 批量查询搜狗sogou代码分享

  本文给大家分享的是使用php实现批量查询搜狗的实例代码,非常的简单实用,有需要的小伙伴可以参考下. php 批量查询搜狗sogou的rank,非常不错,主要是使用了php的file_get_contents()方法. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <?php date_default_timezone_set('Asia/Shanghai'); header('Content-Type: text/html; cha

php+mysqli批量查询多张表数据的方法

 这篇文章主要介绍了php+mysqli批量查询多张表数据的方法,涉及multi_query.store_result及more_results等函数的使用技巧,需要的朋友可以参考下 本文实例讲述了php+mysqli批量查询多张表数据的方法.分享给大家供大家参考.具体实现方法如下: 注意这里使用到了两个新的函数multi_query与store_result,具体代码如下: 代码如下: <?php //1.创建数据库连接对象 $mysqli = new MySQLi("localhost

有好米域名批量查询好用吗

  支持多线程,查询速度超快. 采用多线程独立查询域名是否注册,并有辅助线程查询 其它域名信息,为提高查询速度建立坚强后盾.在频繁查询时, 域名服务器,可能无法及时返回信息,可以尝试使用 查询等待, 有效避免服务器忙的域名状态. 重新查询,域名信息一个不漏 支持批量查询时,域名服务器忙导致的无法获取域名信息. 增加了,重新查询,一键点击,一直重新查询,直到没有服务器忙 导致的域名信息失效的现象. 支持txt记事本,字典文件. 独家创新,域名也可以使用字典文件. 汉字自动转换为拼音,汉字自动转换为

爱站seo工具包之百度指数批量查询工具使用方法

  1. 准备好关键词,复制,粘贴到空白处. 2. 点右边的"批量查询",开始启动,可自动滚动显示查询进度. 3. 提供导出功能,并可以按照有无指数等过滤条件来进行筛选导出. 4. 允许导入txt,xls,xlsx文件,省去复制粘贴的步骤. 5. 提供一键清空功能.

快递批量查询助手怎么使用的方法

  现在选择网上购物的人们越来越多了,查询快递的人也越来越频繁了,通过快递批量查询软件助手可以帮助大家查询到不同公司的快递信息.那么快递批量查询助手怎么使用呢?下面小编就告诉大家怎么使用的方法. 1.首先进行查询延迟设置 2.输入延迟数值 3.一行一个的输入快递单号,点击查询 4.就可以直接看见详细信息了

有好米怎么批量查询域名?

  有好米域名批量查询,是专门针对多线程 域名批量查询 研发的软件.首次使用时,请 点击窗口右上角 设置按钮, 进行 域名的后缀进行设置. 然后在规则查询里进行 输入规则 也可以 使用 字典功能. 字典功能 支持 汉字自动转换全拼 和 汉字自动转换全拼首写. 更多强大功能请亲自体验.