加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

百度风云榜搜索前50名钩子源码

发布时间:2020-12-24 22:10:11 所属栏目:Asp教程 来源:网络整理
导读:发表于中国站长站(Chinaz.com)论坛的贴子。 可在页面任何地方调用,调用方法!--#include file="baidutop50.asp"-- 据发表人说可有效提高网站在搜索引擎中的排名。 baidutop50.asp源代码: % dim url,page,rr,i,cutpage,str 'on error resume next ?Funct

发表于中国站长站(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>")
%>

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读