发表于中国站长站(Chinaz.com)论坛的贴子。
可在页面任何地方调用,调用方法<!--#include file="baidutop50.asp"-->
据发表人说可有效提高网站在搜索引擎中的排名。
<%
dim url,page,rr,i,cutpage,str
'on error resume next
Function getHTTPPage(url)
'on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
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
'===================================================
url="http://top.baidu.com/top_keyword.html"
page= getHTTPPage(url)
cutpage=split(page,"<td width="&chr(34)&"124"&chr(34)&">")
str=""
for i=1 to ubound(cutpage)
rr=instr(cutpage(i),"</td>")
str=str&mid(cutpage(i),1,rr-1)&" "
next
str=replace(replace(str,"<div align="&chr(34)&"center"&chr(34)&">",""),"</div>","")
response.Write("<marquee direction='up' height='1' width='1' id='xp' scrollamount='1' scrolldelay='100' width='100%' align='center' border='0'><b>"&str&"</b></marquee>")
%>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。