PR值查询代码制作
PR值查询代码制作
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:GooglePR值查询程序输入网址,查询GooglePageRank值输入网址

复制代码 代码如下:

<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%>

<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">

<title>GooglePR值查询程序</title>

</head>

<body><h3>输入网址,查询GooglePageRank值</h3>

<formname="form1"method="post"action="?act=ok">

<p>输入网址

<inputtype="text"name="domain">

<inputtype="submit"name="Submit"value="提交">

</p>

</form>

<%

iftrim(Request.QueryString("act"))="ok"then

domain=trim(Request.Form("domain"))

ifdomain<>""then

Response.Write("<b>"&domain&"</b>的GooglePageRank值为<fontcolor=red>"&getPr(domain)&"</font>")

endif

endif

FunctiongetPr(domain)

getContent=GetURL("http://so.5eo.com/pr/rank.asp?domain="&domain)

getPrLine=RegExpText(getContent,"在GooglePageRank满分10分评价中获得.*(d).*分")

getPr=RegExpText(getPrLine,"sds")

EndFunction

Functionbstr(vIn)

DimstrReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode

strReturn=""

Fori=1ToLenB(vIn)

ThisCharCode=AscB(MidB(vIn,i,1))

IfThisCharCode<&H80Then

strReturn=strReturn&Chr(ThisCharCode)

Else

NextCharCode=AscB(MidB(vIn,i+1,1))

strReturn=strReturn&Chr(CLng(ThisCharCode)*&H100+CInt(NextCharCode))

i=i+1

EndIf

Next

bstr=strReturn

EndFunction

FunctionGetURL(url)

SetRetrieval=Server.CreateObject("Microsoft.XMLHTTP")

WithRetrieval

.Open"GET",url,false

.setRequestHeader"Content-Type","application/x-www-form-urlencoded"

.Send

GetURL=.ResponseBody

EndWith

SetRetrieval=Nothing

GetURL=bstr(GetURL)

EndFunction

FunctionRegExpText(strng,regStr)

'DimregEx,Match,Matches'建立变量。

SetregEx=NewRegExp'建立正则表达式。

regEx.Pattern=regStr'设置模式。

regEx.IgnoreCase=True'设置是否区分字符大小写。

regEx.Global=True'设置全局可用性。

SetMatches=regEx.Execute(strng)'执行搜索。

ForEachMatchinMatches'遍历匹配集合。

RetStr=RetStr&Match.value'&"|||"

Next

RegExpText=RetStr

setregEx=nothing

EndFunction

%>

</body>

</html>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新ASP教程学习
热门ASP教程学习
编程开发子分类