欢迎光临
我们一直在努力

Google PR值查询-ASP教程,ASP应用

建站超值云服务器,限时71元/月

 

<%@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值查询程序</title>
</head>

<body><h3>输入网址,查询google pagerank值</h3>
<form name=”form1″ method=”post” action=”?act=ok”>
  <p>输入网址
    <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分评价中获得.*(\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    建立正则表达式。
  regex.pattern = regstr    设置模式。
  regex.ignorecase = true    设置是否区分字符大小写。
  regex.global = true    设置全局可用性。
  set matches = regex.execute(strng)  执行搜索。
  for each match in matches   遍历匹配集合。  
      retstr = retstr & match.value&”|||”     
  next
  regexptext = retstr
  set regex=nothing
end function
%>
</body>
</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Google PR值查询-ASP教程,ASP应用
分享到: 更多 (0)