百度风云榜搜索前50名钩子源码
发表于中国站长站(Chinaz.com)论坛的贴子。
可在页面任何地方调用,调用方法<!--#include file="baidutop50.asp"-->
据发表人说可有效提高网站在搜索引擎中的排名。
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>")
%>
- 转载请注明来源:IT学习网 网址:http://www.t086.com/ 向您的朋友推荐此文章
- 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系我们,我们会尽快予以更正。