您当前的位置: 首页 > 网站编程 > ASP教程 > 页面关键字密度查询原代码

页面关键字密度查询原代码

作者:admin 来源:不详 发布时间: 2008-06-04 08:50 点击:
%@LANGUAGE="VBSCRIPT" CODEPAGE="936"% !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http://www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" con

页面关键字密度查询原代码

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>页面关键字密度查询-站长工具-我爱3GP</title>
<meta name="Description" content="页面关键字密度查询,站长工具,提供各类站长常用查询工具,包括ALEXA排名查询,GOOGLE PR查询,搜索引擎收录查询,关键词排名查询,关键词密度查询,HTML/JS代码互转,简繁转换。" />
<meta name="Keywords" content="页面关键字密度查询,站长工具,查询工具,转换工具" />
<style type="text/css">
<!--
.biao {
 background-position: center;
 border: 2px solid #d4d4d4;
}
td {
 color: #336699;
 line-height: 150%;
 font-size: 13px;
}
th {
 color: #336699;
 line-height: 150%;
 font-size: 14px;
}
hr {
 width: 98%;
 border-top-style: dotted;
 border-right-style: dotted;
 border-bottom-style: dotted;
 border-left-style: dotted;
 color: #336699;
}
-->
</style>
</head>

<body leftMargin=0 topMargin=0 marginwidth="0">
<%
On Error Resume Next
Server.ScriptTimeOut=9999999

function getHTTPPage(Path)
      t = GetBody(Path)
      getHTTPPage=BytesToBstr(t,"GB2312")
End function

function GetBody(url)
      on error resume next
      Set Retrieval = CreateObject("Microsoft.XMLHTTP")
      With Retrieval
      .Open "Get", url, False, "", ""
      .Send
      GetBody = .ResponseBody
      End With
      Set Retrieval = Nothing
End function

function BytesToBstr(body,Cset)
      dim objstream
      set objstream = Server.CreateObject("adodb.stream")
      objstream.Type = 1
      objstream.Mode =3
      objstream.Open
      objstream.Write body
      objstream.Position = 0
      objstream.Type = 2
      objstream.Charset = Cset
      BytesToBstr = objstream.ReadText
      objstream.Close
      set objstream = nothing
End function
function clearHTMLCode(originCode)
dim reg
set reg = new RegExp
reg.Pattern = "<[^>]*>"
reg.Global = true
clearHTMLCode = reg.Replace(originCode, "")
end function
function reallen(str)
 dim l,t,c,i
 l=len(str)
 t=0
 for i=1 to l
 c=Abs(Asc(Mid(str,i,1)))
 if c>255 then
 t=t+2
 else
 t=t+1
 end if
 next
 reallen=t
end function
function CheckTheChar(TheChar,TheString)
'TheChar="要检测的字符串"
'TheString="待检测的字符串"
  If inStr(TheString,TheChar) Then
    For n =1 to Len(TheString)
      If Mid(TheString,n,Len(TheChar))=TheChar Then
   CheckTheChar=CheckTheChar+1
      End if
    Next 
  Else
      CheckTheChar=0
  End If
End function
function Checkin(s)
s=trim(s)
s=replace(s," ","")
s=replace(s," ","")
s=replace(s,"&nbsp;","")
s=replace(s,vbCrlf,"")
s=replace(s,chr(9),"")
Checkin=s
end function
url=request("domain")
key=checkin(request("keywords"))
if len(url)<10 then
url="http://www.5i3gp.cn"
end if
if len(key)<2 then
key="3gp"
end if
getsms=gethttppage(url)
getsms=lcase(checkin(clearhtmlcode(getsms)))
'response.write getsms
'response.end
pagelen=reallen(getsms)
keylen=reallen(key)
keynum=CheckTheChar(key,getsms)
keylentotal=keylen*keynum
keyper=Round((keylentotal/pagelen)*100,2)
%>
<br>
<table width="700" border="0" align="center" cellpadding="3" cellspacing="3" class="biao">
  <tr>
    <th colspan="2" align="center">欢迎您使用本站的 关键词密度 查询工具<br />如果您觉得本站对您有帮助,请收藏或者推荐给您的朋友。</th>
  </tr>
  <tr>
    <td colspan="2" align="center"><hr /></td>
  </tr>
 
  <tr>
    <td>
  <table border="0" width="480" align="center" cellpadding="0" cellspacing="0" class="biao">
  <form action="pagekey.asp" method="post">
   <tr>
    <th align="center" height="30">>>页面 关键字/关键词 密度 查询<<</th>
   </tr>
   <tr>
    <td bgcolor="#6699cc" height="6"></td>
   </tr>
   <tr>
    <td height="30" align="center">页 面:<input onblur="if (value ==''){value='http://www.5i3gp.cn'}" onmouseover="this.focus()" onfocus="this.select()" size="35" value="<%=url%>" name="domain"></td>
   </tr>
   <tr>
    <td height="30" align="center">关键词:<input onblur="if (value ==''){value='3gp'}" onmouseover="this.focus()" onfocus="this.select()" onclick="if(this.value=='3gp')this.value=''" size="15" value="<%=key%>" name="KeyWords">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="submit" type="submit" value="查 询">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
   </tr>
   <tr><td height="30">注:字符长度按字节算,每个中文、半角符号占两字节,每个英文、全角符号占一字节;页面长度不包括空格、换行、制表符。<br /></td></tr>
  </form>
  </table>
 </td>
 <td>
  <table border="0" width="220" align="center" cellpadding="0" cellspacing="0" height="140" class="biao">
   <tr>
    <td style="line-height: 170%;">页面代码总长度:<%=pagelen%> 字节<br />
      关键字符串长度:<%=keylen%> 字节<br />
      关键字出现频率:<%=keynum%>   次<br />
      关键字符总长度:<%=keylentotal%> 字节<br />
      密度结果计算:<%=keyper%>%<br />
      密度建议值:2%≦密度≦8%</td>
   </tr>
  </table>
 </td>
  </tr>
</table>
</body>
</html>

分享到:
本文"页面关键字密度查询原代码"由远航站长收集整理而来,仅供大家学习与参考使用。更多网站制作教程尽在远航站长站。
顶一下
(0)
0%
踩一下
(0)
0%
[点击 次] [返回上一页] [打印]
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
关于本站 - 联系我们 - 网站声明 - 友情连接- 网站地图 - 站点地图 - 返回顶部
Copyright © 2007-2013 www.yhzhan.com(远航站长). All Rights Reserved .
远航站长:为中小站长提供最佳的学习与交流平台,提供网页制作与网站编程等各类网站制作教程.
官方QQ:445490277 网站群:26680406 网站备案号:豫ICP备07500620号-4