PR值查詢代碼制作
更新時(shí)間:2006年08月23日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Google PR值查詢程序</title>
</head>
<body><h3>輸入網(wǎng)址,查詢Google PageRank值</h3>
<form name="form1" method="post" action="?act=ok">
<p>輸入網(wǎng)址
<input type="text" name="domain">
<input type="submit" name="Submit" value="提交">
</p>
</form>
<%
if trim(Request.QueryString("act"))="ok" then
domain=trim(Request.Form("domain"))
if domain<>"" then
Response.Write("<b>"&domain&"</b> 的Google PageRank值為<font color=red>"&getPr(domain)&"</font>")
end if
end if
Function getPr(domain)
getContent=GetURL("http://so.5eo.com/pr/rank.asp?domain="&domain)
getPrLine=RegExpText(getContent,"在Google PageRank滿分10分評(píng)價(jià)中獲得.*(\\d).*分")
getPr=RegExpText(getPrLine,"\\s\\d\\s")
End Function
Function bstr(vIn)
Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bstr = strReturn
End Function
Function GetURL(url)
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, false
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send
GetURL = .ResponseBody
End With
Set Retrieval = Nothing
GetURL=bstr(GetURL)
End Function
Function RegExpText(strng,regStr)
'Dim regEx, Match, Matches ' 建立變量。
Set regEx = New RegExp ' 建立正則表達(dá)式。
regEx.Pattern = regStr ' 設(shè)置模式。
regEx.IgnoreCase = True ' 設(shè)置是否區(qū)分字符大小寫。
regEx.Global = True ' 設(shè)置全局可用性。
Set Matches = regEx.Execute(strng) ' 執(zhí)行搜索。
For Each Match in Matches ' 遍歷匹配集合。
RetStr = RetStr & Match.value'&"|||"
Next
RegExpText = RetStr
set regEx=nothing
End Function
%>
</body>
</html>
相關(guān)文章
利用 cache 做對(duì)比靜態(tài)頁(yè)的網(wǎng)頁(yè)技術(shù)
利用 cache 做對(duì)比靜態(tài)頁(yè)的網(wǎng)頁(yè)技術(shù)...2007-10-10不能使用“;文件已在使用中 Microsoft JET Database Engine
不能使用 '';文件已在使用中。說明: 執(zhí)行當(dāng)前 Web 請(qǐng)求期間,出現(xiàn)未處理的異常。請(qǐng)檢查堆棧跟蹤信息,以了解有關(guān)該錯(cuò)誤以及代碼中導(dǎo)致錯(cuò)誤的出處的詳細(xì)信息2012-06-06使用模板實(shí)現(xiàn)ASP代碼與頁(yè)面分離
使用模板實(shí)現(xiàn)ASP代碼與頁(yè)面分離...2006-08-08ASP讀取日期單日期自動(dòng)補(bǔ)零函數(shù)代碼
fillzero 函數(shù):月和日這兩個(gè)日期如果是單數(shù)的話前面補(bǔ)0。如2011年3月3日一般格式是2011-3-3通過函數(shù)轉(zhuǎn)化成2011-03-03這樣的格式。2011-01-01使用FSO把文本信息導(dǎo)入數(shù)據(jù)庫(kù)
使用FSO把文本信息導(dǎo)入數(shù)據(jù)庫(kù)...2006-08-08asp下對(duì)POST提交數(shù)據(jù)限制的解決方法
由于微軟對(duì)POST提交數(shù)據(jù)的大小進(jìn)行了限制,當(dāng)表單發(fā)送的數(shù)據(jù)量很大時(shí),就會(huì)報(bào)錯(cuò)(錯(cuò)誤 "ASP 0107 : 80004005")。原因是微軟對(duì)用Request.Form()可接收的最大數(shù)據(jù)限制為100K字節(jié)。2008-06-06