La copie de code est la suivante:
<% @ Lingots = "vbscript" codepage = "936"%>
<! Doctypehtmlpublic "- // w3c // dtdhtml4.01transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<adal>
<Metahttp-Equiv = "Content-Type" Content = "Text / Html; charSet = GB2312">
<Title> Programme de requête de valeur Googlepr </TITME>
</ head>
<body> <h3> Entrez l'URL et interrogez la valeur GooglePagerank </H3>
<formName = "form1" méthode = "post" action = "? act = ok">
<p> Entrez l'URL
<portType = "text" name = "domaine">
<putyType = "soumi" name = "soumi" value = "soumis">
</p>
</ form>
<%
ifTrim (request.QueryString ("Act")) = "OK" puis
domain = trim (request.form ("domaine"))
ifdomain <> "" alors
Response.Write ("<b>" & Domain & "</b> La valeur GooglePagerank est <fontcolor = red>" & getPr (domaine) & "</font>")
endire
endire
FunctionGetPr (domaine)
getContent = geturl ("http://so.5eo.com/pr/rank.asp?domain=" & Domain)
getPrLin = regexptext (getContent, "get. * (// d). * points dans googlepagerank complet score complet de 10 points")
getPr = regexptext (getPrLin, "// s // d // s")
Finition de fin
Functionbstr (VIN)
Dimstrreturn, I, Thischarcode, Innercode, Hight8, Low8, NextCharcode
strreturn = ""
Fori = 1Tolenb (vin)
ThisCharcode = ASCB (midb (vin, i, 1))
Ifthischarcode <& h80Then
Streturn = Strreturn & Chr (ThisCharcode)
Autre
NextCharcode = ASCB (Midb (Vin, I + 1,1))
Streturn = Streturn & Chr (Clng (ThisCharcode) * & H100 + Cint (NextCharcode))
i = i + 1
Endire
Suivant
BSTR = STRRETURN
Finition de fin
FunctionGetUrl (URL)
SetRetrieval = server.createObject ("Microsoft.xmlhttp")
Avec un peu de temps
.Open "Get", URL, faux
.SetRequestHeader "Content-Type", "Application / X-WWW-Form-Urlencoded"
.Envoyer
GetUrl = .Responsebody
Fin
SetRetrieval = rien
Geturl = bstr (geturl)
Finition de fin
FunctionRegexptext (strNg, regstr)
«DimRegex, Match, Matchs» crée des variables.
SetRegex = newRegexp 'crée une expression régulière.
regex.Pattern = Mode de définition de Regstr.
regex.ignorecase = true 'set s'il faut être sensible à la casse.