记录蜘蛛爬行的代码 ASP
先建立一个 robots 文件夹<%
Sub robot()
Dim robots:robots="Baiduspider+@Baidu|Googlebot@Google|ia_archiver@Alexa|IAArchiver@Alexa|ASPSeek@ASPSeek|YahooSeeker@Yahoo|sohu-search@Sohu|help.yahoo.com/help/us/ysearch/slurp@Yahoo|sohu-search@SOHU|MSNBOT@MSN"
dim I1,I2,l1,l2,l3,i,rs
l2=false
l1=request.servervariables("http_user_agent")
F1=request.ServerVariables("SCRIPT_NAME")
I1=split(robots,chr(124))
for i=0 to ubound(I1)
I2=split(I1(i),"@")
if instr(lcase(l1),lcase(I2(0)))>0 then
l2=true:l3=I2(1):exit for
end if
next
if l2 and len(l3)>0 then'如果是爬虫,就更新爬虫信息
FilePath = Server.Mappath("robots/"&l3&"_robots.txt")
'记录蜘蛛爬行
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set Fout = Fso.OpenTextFile(FilePath,8,True)
Fout.WriteLine "索引页面:"&F1
Fout.WriteLine "蜘蛛:"&l3&chr(32)&chr(32)&"更新时间:"&Now()
Fout.WriteLine "-----------------------------------------------"
Fout.Close
Set Fout = Nothing
Set Fso = Nothing
end if
end Sub
%> 1:空间需要支持ASP;
2:把文件上传到根目录;
3:在你所需要监测的页里插入调用的代码:<!--#include file = "rob.asp"--> 然后保存为*.asp
如:
<html>
……
<!--#include file = "rob.asp"-->
</body>
</html>
4:文件spider.asp可查看蜘蛛来路!
[ 本帖最后由 lelemi 于 2007-5-5 17:28 编辑 ] http://www.softhy.net/down.asp?id=9719&no=1 怎么不给个演示看看? 去掉yahoo吧,yahoo一次要出动几百个蜘蛛,文件记录的话。。。 顺便,这文件一旦被利用着CC,效果会狠爽的。。
回复 #6 y 的帖子
宝宝你虾米时间又研究ASP了? 原帖由 hsphere 于 2007-5-5 18:02 发表 http://www.jgwy.net/bbs/images/common/back.gif宝宝你虾米时间又研究ASP了?
:@ 猜的。。。。 yahoo最多出动了4000多只,结果把我service unvalible了
回复 #9 hsphere 的帖子
;P ;P ;P垃圾服务器。。。。。。。
页:
[1]