コードコピーは次のとおりです。
<%@言語= "vbscript" codepage = "936"%>
<
<html>
<head>
<metahttp-equiv = "content-type" content = "text/html; charset = gb2312">
<Title> GooglePR値クエリプログラム</title>
</head>
<Body> <H3> URLを入力し、GooglePagerank値をクエリ</h3>
<formName = "form1" method = "post" action = "?act = ok">
<p> URLを入力します
<inputtype = "text" name = "domain">
<inputtype = "submit" name = "submit" value = "submit">
</p>
</form>
<%
iftrim(request.querystring( "act"))= "ok" then
domain = trim(request.form( "domain"))
ifdomain <> "" then
respons.write( "<b>"&domain& "</b>のGooglePagerank値は<fontcolor = red>"&getPr(domain)& "</font>")
endif
endif
functiongetPR(ドメイン)
getContent = getUrl( "http://so.5eo.com/pr/rank.asp?domain="&domain)
getPrline = regexptext(getContent、 "get。*(// d)。
getPr = regexptext(getPrline、 "// s // d // s")
エンド機能
functionbstr(vin)
dimstrreturn、i、thischarcode、innercode、hight8、low8、next charcode
strreturn = ""
fori = 1tolenb(vin)
thischarcode = ascb(midb(vin、i、1))
ifthischarcode <&h80then
strreturn = strreturn&chr(thischarcode)
それ以外
NextCharcode = ascb(midb(vin、i+1,1))
strreturn = strreturn&chr(clng(thischarcode)*&h100+cint(nextcharcode)))
i = i+1
endif
次
bstr = strreturn
エンド機能
functiongeturl(url)
setretrieval = server.createObject( "microsoft.xmlhttp")
withretrieval
.open "get"、url、false
.setRequestheader "Content-Type"、 "Application/x-www-form-urlencoded"
。送信
getUrl = .ResponseBody
終わりに
setretrieval =何もない
geturl = bstr(geturl)
エンド機能
functionregexptext(strng、regstr)
「Dimregex、Match、Matches」は変数を作成します。
setRegex = newRegexp '正規表現を作成します。
regex.pattern = regstr 'セットモード。
regex.ignorecase = true 'ケースに敏感であるかどうかを設定します。