Fanfou 和 twitter 的 robots.txt
robots.txt 其实是一个说不完的话题,这次稍微比较一下的 饭否 和 Twitter 的 robots.txt。
饭否
Link: http://www.fanfou.com/robots.txt
User-agent: *
Disallow: /home
Disallow: /message
Disallow: /favorites
分别看看这被禁止的 URL 指向的页面: 在没有登陆的情况下, /home 及 /favorites 都是重定向至首页,这两条规则没有什么问题; 重点在于 /message 这条规则: 它禁止爬虫对 /message 该路径的爬行; 例如 我在饭否的页面,这个页面将不被遵守 robots.txt 规则的爬虫索引,或许这只是出于减轻索引对服务器的负担,但同时却让减少被索引的页面数量。
Link: http://www.twitter.com/robots.txt
#Google Search Engine Robot
User-agent: Googlebot
# Crawl-delay: 10 -- Googlebot ignores crawl-delay ftl
Disallow: /*?
#Yahoo! Search Engine Robot
User-Agent: Slurp
Crawl-delay: 10
Disallow: /*?
#Microsoft Search Engine Robot
User-Agent: msnbot
Crawl-delay: 10
Disallow: /*?
# Every bot that might possibly read and respect this file.
User-agent: *
Disallow: /*?
相对来说,Twitter 对爬虫的爬行没有太多的限制,针对支持 Crawl-delay 的 Yahoo! 和 MSN 还设置了爬行速度(10 秒)。
Reference:
- A Standard for Robot Exclusion
- robots.txt with multi user-agent
- Robots.txt Generator - 一个 robots.txt 的生成小工具。
