找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 370|回复: 9

记录蜘蛛爬行的代码 ASP

[复制链接]
发表于 2007 年 5 月 5 日 17:20:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
先建立一个 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
%>
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
 楼主| 发表于 2007 年 5 月 5 日 17:26:46 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
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 编辑 ]
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2007 年 5 月 5 日 17:28:43 | 显示全部楼层
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 5 月 5 日 17:32:07 | 显示全部楼层
怎么不给个演示看看?
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

y
发表于 2007 年 5 月 5 日 17:57:27 | 显示全部楼层
去掉yahoo吧,yahoo一次要出动几百个蜘蛛,文件记录的话。。。
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

y
发表于 2007 年 5 月 5 日 17:58:26 | 显示全部楼层
顺便,这文件一旦被利用着CC,效果会狠爽的。。
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 5 月 5 日 18:02:04 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价

回复 #6 y 的帖子

宝宝你虾米时间又研究ASP了?
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

y
发表于 2007 年 5 月 5 日 18:04:24 | 显示全部楼层
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 5 月 5 日 18:41:38 | 显示全部楼层
yahoo最多出动了4000多只,结果把我service unvalible了
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2007 年 5 月 5 日 19:29:25 | 显示全部楼层

回复 #9 hsphere 的帖子


垃圾服务器。。。。。。。
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 2 月 2 日 01:57 , Processed in 0.019069 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表