A cópia do código é a seguinte:
<%@Idioma = "vBScript" codePage = "936"%>
<!
<html>
<head>
<metahttp-equiv = "content-type" content = "text/html; charset = gb2312">
<title> Programa de consulta de valor do Googlepr
</head>
<Body> <H3> Digite o URL e consulte o valor do GooglePagerank </h3>
<formname = "form1" método = "post" action = "? Act = ok">
<p> Digite o URL
<inputtype = "text" name = "domain">
<inputType = "submeter" name = "submeter" value = "submeter">
</p>
</morm>
<%
iftrim (request.QueryString ("Act")) = "OK" Então
Domain = Trim (request.form ("domínio")))
ifdomain <> "" então
Response.Write ("<b>" & Domain & "O valor do GooglePagerank do Google é <fontcolor = Red>" & getpr (domínio) & "</font>")
endif
endif
FunctionGetpr (domínio)
getContent = geturl ("http://so.5eo.com/pr/rank.asp?domain=" e domínio)
getPrline = regexPtext (getContent, "get.* (// d).
getPr = regexPtext (getPrine, "// s // d // s")
Função final
FunctionBSTR (VIN)
Dimstrreturn, i, thisCharcode, InnerCode, Hight8, Low8, NextCharCode
strreturn = ""
Fori = 1tolenb (VIN)
ThisCharcode = ASCB (MIDB (VIN, i, 1))
IfthScharcode <& h80Then
strreturn = strreturn & ch (thischarcode)
Outro
NextcharCode = ASCB (MIDB (VIN, I+1,1))
strreturn = strreturn & ch (clng (thischarcode)*& h100+cint (nextcharcode))
i = i+1
Endif
Próximo
bstr = strreturn
Função final
FunctionGeturl (URL)
Setretrieval = server.createObject ("Microsoft.xmlHttp")
Withretrieval
.Popear "Get", URL, Falso
.SetRequestHeader "Tipo de Conteúdo", "Aplicativo/X-Www-Form-Formle-Urlencoded"
.Enviar
Geturl = .Responsebody
ENDWITH
Setretrieval = nada
Geturl = bstr (geturl)
Função final
FunctionRegexPtext (strng, regstr)
'Dimregex, Match, Matches' cria variáveis.
SetRegex = newRegexp 'cria uma expressão regular.
regex.pattern = Regstr 'Set Mode.
regex.ignorecase = true 'Defina se deve ser sensível ao caso.