28,391
社区成员
发帖
与我相关
我的任务
分享
<?php
/*
if( $_SERVER['HTTP_HOST'] == 'pr.wofav.cn' )
{
header("Location: http://pr.wofav.cn/");
exit();
}
*/
/*
*功能:对URL进行编码
*参数说明:$web_url 网站URL,不包含"http://",例如pr.wofav.cn
*完成时间:2009年4月10日
*/
function HashURL($url)
{$SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
$Result = 0x01020345;
for ($i=0; $i<strlen($url); $i++)
{
$Result ^= ord($SEED{$i%87}) ^ ord($url{$i});
$Result = (($Result >> 23) & 0x1FF) | $Result << 9;
}
return sprintf("8%x", $Result);
}
/*
*功能:获取pagerank
*参数说明:$domain 网站域名,不包含"http://",例如pr.wofav.cn
*完成时间:2009年9月19日
*/
function pagerank($domain)
{
$StartURL = "http://www.google.com/search?client=navclient-auto&features=Rank:&q=info:";
$GoogleURL = $StartURL.$domain. '&ch='.HashURL($domain);
$fcontents = file_get_contents("$GoogleURL");
$pagerank = substr($fcontents,9);
if (!$pagerank) return "0";else return $pagerank;
}
$chaxun_bool = 0;
if ( isset($_GET['website']) )
{
$chaxun_bool = 1;
$website = $_GET['website'];
$website = str_replace("http://","",$website);
@ $pr = pagerank("$website");
@ date_default_timezone_set(PRC);
$now_date = date("Y年n月j日 G时i分s秒");
}
?>
<?php
if( $chaxun_bool == 0 )
{
echo '';
}
else
{
echo $pr;
}
?>
lseif sl="pr" then
PRCldeContent =getHTTPPage("pr.php?website="&sw&) '要提取页面的url地址
Startyahoo="/images/pagerank"
Overyahoo=".gif"
mmm=GetBody(PRCldeContent,Startyahoo,Overyahoo,IncluL,IncluR)
mmm=replace(mmm,chr(10),"")
<%
Function GetHttpPage(HttpUrl)
If IsNull(HttpUrl)=True Then
response.Write("请输入网址!")
Exit Function
End If
On Error Resume Next
Dim Http
Set Http=server.createobject("MSX"&"ML2.XML"&"HTTP")
Http.open "GET",HttpUrl,False
Http.Send()
If Http.Readystate<>4 then
Set Http=Nothing
response.Write("该网页无法访问!")
Exit function
End if
if InStr(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")=0 then
GetHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")
else
if left(split(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")(1),6)="gb2312" or left(split(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")(1),6)="GB2312" then
GetHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
elseif left(split(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")(1),3)="gbk" or left(split(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")(1),3)="GBK" then
GetHTTPPage=bytesToBSTR(Http.responseBody,"GBK")
elseif left(split(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")(1),5)="utf-8" or left(split(bytesToBSTR(Http.responseBody,"UTF-8"),"charset=")(1),5)="UTF-8" then
GetHTTPPage=bytesToBSTR(Http.responseBody,"UTF-8")
else
GetHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")
end if
end if
Set Http=Nothing
If Err.number<>0 then
Err.Clear
End If
End Function
Function BytesToBstr(Body,Cset)
Dim Objstream
Set Objstream = Server.CreateObject("adod"&"b.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
%>
不知道对不对 大家帮忙改正下 我的QQ36032075
直接输入网站 pr.php?website=http://***** 可以获取到pr
在线等结果