PR值查詢(xún)代碼制作
更新時(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值查詢(xún)程序</title>
</head>
<body><h3>輸入網(wǎng)址,查詢(xún)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ū)分字符大小寫(xiě)。
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)文章
asp 實(shí)現(xiàn)對(duì)SQL注入危險(xiǎn)字符進(jìn)行重編碼處理的函數(shù)
asp 實(shí)現(xiàn)對(duì)SQL注入危險(xiǎn)字符進(jìn)行重編碼處理的函數(shù)...2007-08-08
asp 刪除數(shù)據(jù)并同時(shí)刪除圖片的代碼
實(shí)現(xiàn)刪除記錄同時(shí)刪除圖片,一般的情況為了性能都是用編輯器的同時(shí)將文章中的圖片,保存在一個(gè)字段里面,多個(gè)圖片用逗號(hào)分開(kāi),方便后期的刪除處理。2010-05-05
asp Response.flush 實(shí)時(shí)顯示進(jìn)度
如果你知道Response.Flush和Response.Clear,那你就可以不用這樣的等待了。每生成一個(gè)Html頁(yè)面,就用Response.write立即返回一條信息,提示該條數(shù)據(jù)庫(kù)記錄已經(jīng)生成Html。2008-08-08
Asp實(shí)現(xiàn)的數(shù)據(jù)庫(kù)連接池功能函數(shù)分享
這篇文章主要介紹了Asp實(shí)現(xiàn)的數(shù)據(jù)庫(kù)連接池功能函數(shù)分享,本函數(shù)能夠加快網(wǎng)頁(yè)的訪問(wèn)速度,降低數(shù)據(jù)庫(kù)的壓力,需要的朋友可以參考下2014-07-07

