asp 网站PR值查询系统源码[绝对原创]

 网站PR值查询系统源码共2个文件

 

prvalue.asp

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>pr值查询</title><meta name="keywords" content="黑龙江分业企业网,pr值查询查询系统" /><style type="text/css"><!--
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
 font-size: 12px;
 color: #000000;
 text-decoration: none;
}--></style><%
Function GetURL(URL)
Set http=Server.CreateObject("Microsoft.XMLHTTP")
 On Error Resume Next
 http.Open "GET",URL,False
 http.send()
 if Err then
 Err.Clear
 GetURL="Rank_1:1:0"
 Exit Function
 End if
 getHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")
set http=nothing
GetURL=getHTTPPage
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%></head><body>&nbsp;<a href="http://www.xin800.com" target="_blank">黑龙江分业企业网</a><form id="form1" name="form1" method="post" action=""><table width="550" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td colspan="2">&nbsp;</td></tr><tr><td height="26" colspan="2" align="center"><strong>网站PR值查询系统</strong></td></tr><tr><td width="415">&nbsp;</td><td width="135">&nbsp;</td></tr><tr><td align="right">请输入你的网址:<input name="Search" type="hidden" id="Search" value="True" /><input name="Domain" type="text" id="Domain" value="<%=Trim(Request("Domain"))%>" size="35" />&nbsp;&nbsp;</td><td><input type="submit" name="Submit" value="提交" /></td></tr><tr><td align="right">&nbsp;</td><td>&nbsp;</td></tr><tr><td colspan="2" align="center">注意:&nbsp;在google PageRank中 xin800.com 与 www.xin800.com 的值不一样!</td></tr><tr><td colspan="2"></td></tr></table></form><table width="550" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="18">查询结果:</td></tr><tr><td>&nbsp;&nbsp;<%
If Request("Search")="True" Then
StarTime=Timer()
Domain=Trim(Request("Domain"))
URL="http://www.google.com/search?client=navclient-auto&ch="&GetURL("Http://"&Request.ServerVariables("Server_NAME")&"/pr.asp?Domain="&Domain)&"&features=Rank&q=info:"&Domain
Rank=Split(GetURL(URL),":")
On Error Resume Next
PageRank=Rank(Clng(UBound(Rank)))
If Err Then
Err.Clear
PageRank=Rank
End If
If Len(PageRank)>4 Then
PageRank=0
End if
Response.Write("<a href=http://"&Trim(Request("Domain"))&" target=_blank>"&Trim(Request("Domain"))&"</a> 在Google PageRank满分10分评价中获得 "&PageRank&" 分")
EndTime=Timer()
Response.Write("<p>查询共用 <b> "&FormatNumber((EndTime-StarTime),3,-1)&"</b> 秒</p>")
End if
%></td></tr></table></body></html>

 

Pr.asp(URL算法)

 

<script language="javascript" runat="server">
Response.Charset="GB2312"
function GetPR(url)
{
 url ="info:" + url;
 ch = GoogleCH(str_asc(url));
 ch = "6" + ch
 return ch;
}

function str_asc(string) {
 result = new Array();
  lin = string.length
 for(i=0;i<lin;i++) {
 result[i] = string.substring(i).charCodeAt(0);
 }
 return result;
}

function yiweitwo(a, b)
{
 z = 0x80000000;

 if (z & a)
 {
 a = (a>>1);
 a &= (~z);
 a |= 0x40000000;
 a = (a>>(b-1));
 }
 else
 {
 a = (a>>b);
 }
 return a;
}

function yiwei(a,b,c)
{
 a -= b; a -= c; a ^= (yiweitwo(c,13));
 b -= c; b -= a; b ^= (a<<8);
 c -= a; c -= b; c ^= (yiweitwo(b,13));
 a -= b; a -= c; a ^= (yiweitwo(c,12));
 b -= c; b -= a; b ^= (a<<16);
 c -= a; c -= b; c ^= (yiweitwo(b,5));
 a -= b; a -= c; a ^= (yiweitwo(c,3));
 b -= c; b -= a; b ^= (a<<10);
 c -= a; c -= b; c ^= (yiweitwo(b,15));
 
 var myarray = new Array (a,b,c);
 
 return myarray;
}

function GoogleCH(url)
{
 
 length = url.length;
 
 a = b = 0x9E3779B9;
 c = 0xE6359A60;
 k = 0;
 len = length;
 while(len >= 12)
 {
 a += (url[k+0] +(url[k+1]<<8) +(url[k+2]<<16) +(url[k+3]<<24));
 b += (url[k+4] +(url[k+5]<<8) +(url[k+6]<<16) +(url[k+7]<<24));
 c += (url[k+8] +(url[k+9]<<8) +(url[k+10]<<16)+(url[k+11]<<24));
 mid = yiwei(a,b,c);
 a = mid[0]; b = mid[1]; c = mid[2];
 k += 12;
 len -= 12;
 }

 c += length;
 switch(len)
 {
 case 11:
    {
      c+=(url[k+10]<<24);
      c+=(url[k+9]<<16);
      c+=(url[k+8]<<8);
      b+=(url[k+7]<<24);
      b+=(url[k+6]<<16);
      b+=(url[k+5]<<8);
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    }
 case 10:
    {
      c+=(url[k+9]<<16);
      c+=(url[k+8]<<8);
      b+=(url[k+7]<<24);
      b+=(url[k+6]<<16);
      b+=(url[k+5]<<8);
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    } 
 case 9 :
    {
      c+=(url[k+8]<<8);
      b+=(url[k+7]<<24);
      b+=(url[k+6]<<16);
      b+=(url[k+5]<<8);
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    }
 case 8 :
    {
      b+=(url[k+7]<<24);
      b+=(url[k+6]<<16);
      b+=(url[k+5]<<8);
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    } 
 case 7 :
    {
      b+=(url[k+6]<<16);
      b+=(url[k+5]<<8);
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    }
 case 6 :
    {
      b+=(url[k+5]<<8);
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    }
 case 5 :
    {
      b+=(url[k+4]);
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    } 
 case 4 :
    {
      a+=(url[k+3]<<24);
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    } 
 case 3 :
    {
      a+=(url[k+2]<<16);
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    }
 case 2 :
    {
      a+=(url[k+1]<<8);
      a+=(url[k+0]);
      break;
    } 
 case 1 :
    {
      a+=(url[k+0]);
      break;
    }
 }
 mid = yiwei(a,b,c);
 return mid[2];
}
var Domain=Request("Domain")
Response.Write(GetPR(Domain));
</script>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值