在heritrix3.x的CXML文件中经常出现surt这个属性,这个属性到底是什么呢,因为是一个缩写,而且比较小众,从字面上看不出意思,还是来看下官方的完整解释吧:

Sort-friendly URI Reordering Transform. Converts URIs of the form: scheme://userinfo@domain.tld:port/path?query#fragment ...into... scheme://(tld,domain,:port@userinfo)/path?query#fragment The '(' ')' characters serve as an unambiguous notice that the so-called 'authority' portion of the URI ([userinfo@]host[:port] in http URIs) has been transformed; the commas prevent confusion with regular hostnames. This remedies the 'problem' with standard URIs that the host portion of a regular URI, with its dotted-domains, is actually in reverse order from the natural hierarchy that's usually helpful for grouping and sorting. The value of respecting URI case variance is considered negligible: it is vanishingly rare for case-variance to be meaningful, while URI case- variance often arises from people's confusion or sloppiness, and they only correct it insofar as necessary to avoid blatant problems. Thus the usual SURT form is considered to be flattened to all lowercase, and not completely reversible.

地址为:http://crawler.archive.org/apidocs/org/archive/util/SURT.html

各类人体艺术写真、摄影、模特摄影、写真照片 
   

简单的说,意思是将传统的点号域名转化为另一种避免歧义的域名格式了,在配置文件中应该会用到。

配置实例:http://tech.groups.yahoo.com/group/archive-crawler/message/7375

各类人体艺术写真、摄影、模特摄影、写真照片 
   

<bean class="org.archive.modules.deciderules.DecideRuleSequence">
<property name="rules">
<list>
<bean class="org.archive.modules.deciderules.RejectDecideRule" />
<bean
class="org.archive.modules.deciderules.surt.SurtPrefixedDecideRule">
<property name="seedsAsSurtPrefixes" value="false" />
<property name="surtsSource">
<bean class="org.archive.spring.ConfigString">
<property name="value">
<value>
+http://(com,blogs,test,)/between_the_lines/page
+http://(com,blogs,test,)/between_the_lines/archive
</value>
</property>
</bean>
</property>
</bean>
<bean class="org.archive.modules.deciderules.MatchesListRegexDecideRule">
<property name="regexList">
<list>
<value>^http://test\.blogs\.com/between_the_lines/$</value>
<value>^.*index.html*$</value>
</list>
</property>
</bean>
</list>
</property>
</bean>

上述配置的效果是:爬行下列目录中包含index.html的页面

http://test.blogs.com/between_the_lines/
>
> http://test.blogs.com/between_the_lines/page*
>
> http://test.blogs.com/between_the_lines/archives*

————————————————————————————————————————

经测试,surtsSource下限定的爬行域名解析当前页面,并仍然会爬到外链(有待进一步求解)

各类人体艺术写真、摄影、模特摄影、写真照片 
   

具体的做法如下:

1.在org.archive.crawler.frontier下新建一个ELFHashQueueAssignmentPolicy类,这个类要注意继承自 QueueAssignmentPolicy。

2.在该类下编写代码如下:

1. publicclass ELFHashQueueAssignmentPolicyextends QueueAssignmentPolicy

2.  {

3.     privatestatic finalLogger logger= Logger

4.     .getLogger(ELFHashQueueAssignmentPolicy .class.getName());

5.

6.     publicString getClassKey(CrawlController controller,

7.        CandidateURI cauri){

8.         String uri = cauri.getUURI().toString();

9.        long hash = ELFHash(uri);

10.                 String a = Long.toString(hash % 100);

11.                 returna;

12.             }

13.            publiclong ELFHash(String str){

14.                long hash = 0;

15.                long x = 0;

16.                for(inti = 0; i < str.length(); i++){

17.                     hash = (hash << 4) + str.charAt(i);

18.                    if((x = hash & 0xF0000000L) != 0){

19.                         hash ^= (x >> 24);

20.                         hash &= ~x;

21.                     }

22.                 }

23.                return (hash & 0x7FFFFFFF);

24.            }

各类人体艺术写真、摄影、模特摄影、写真照片 
   

heritrix3.x--SURT / 限定heritrix的爬行域相关推荐

  1. 摄影是一门接地气的的艺术

    前两天听了一加的发布会,一加为了从极客圈进入大众视野,与著名相机厂商哈苏联手打造了哈苏模式的手机摄影. 手机摄影已经成了主流手机厂商的必争之地,用了多快的CPU,大众毫无感觉,照片颜色特别漂亮,大众是 ...

  2. 【爬虫】Heritrix 3.2安装和运行实例

    1 Heritrix安装 1.1 本地环境 系统:Ubuntu 16.04 Heritrix版本:3.2 JDK版本:1.7(Heritrix 3.2不支持Java8) 1.2 下载解压 下载方式如下 ...

  3. heritrix 相关

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html 内部邀请码:C8E245J (不写邀请码,没有现金送) 国 ...

  4. 服务器站点解密出错,修改域超级管理员密码后站点复制出错。

    这个是repadmin检查结果: C:\Users\administrator.123>repadmin /kcc Repadmin: 针对所有 DC localhost 运行命令 /kcc S ...

  5. 向服务器获取同步信息失败,主域服务器和辅助域服务器数据同步失败

    单位上的域控平台正常运行一年后,某天发现主域和辅助域服务器数据不能同步,经检查网络连接正常,135.139.445等共享端口正常开启,用dcdiag命令检测主域服务器后,报告如下: C:\Users\ ...

  6. 售价39.98万元 集度ROBO-01探月限定版追加1000体验官名额

    10月27日,集度"月探索·越值得探索"新车发布会在集度上海总部RoboBase举行,首款汽车机器人ROBO-01探月限定版正式发布,新车售价39.98万元,其所有智能化能力做到顶 ...

  7. Silverlight 应用程序之间在客户端通信

    运行在同一台电脑上的多个 Silverlight 应用程序可以通过本地消息进行通信,通信是在客户端进行的,不需要与服务端交互.使用这一功能可以使在同一页面承载的多个 Silverlight 应用程序之 ...

  8. sql创建计算机用户,2015年计算机四级数据库复习要点:SQL Server 登录账户

    2015年计算机四级数据库复习要点:SQL Server 登录账户 系统内置的登录账户 1. BUILTIN\Administrators:是一个Windows组账户,表示所有的Windows Adm ...

  9. 黑客攻防技术宝典Web实战篇第2版—第7章 攻击会话管理

    7.1 状态要求 1.HTTP是无状态的,基于请求-响应模型,每条消息代表一个独立的事物. 2.大多数Web站点实际为Web应用程序,他们允许用户注册登录,购买销售,记住用户喜好,它们可以根据用户的单 ...

最新文章

  1. IPython和Jupyter关系及区别
  2. Tensorflow—继续优化,使MNIST准确率98%以上
  3. QLineEdit学习
  4. C#:RichTextBox 追加其它颜色的行列
  5. 阿里云物联网平台远程配置功能JAVA 示例参考
  6. 腾讯内容平台部-视频内容理解算法实习生
  7. SpringBoot项目打成War包??
  8. java微信第三方支付
  9. linux netcat命令实例
  10. 基于RV1126平台imx291分析 --- 基于subdev的方式
  11. M1芯片,PS2022版真的来了。Photoshop 2022 for Mac中文版介绍安装教程,支持Monterey系统
  12. 2018年中考计算机考试成绩,2018年北京中考考试科目、时间及成绩公布通知
  13. 三角形内切圆和外接圆半径及其面积计算
  14. 大使、布道师、贡献者,OpenHarmony社区发起三大贡献者激励计划
  15. (转载)视频采集学习笔记
  16. Java基础之——动态代理
  17. MS SQL2016的安装
  18. Python爬取《三国演义》并且制作词云
  19. 电脑硬盘分区软件哪个好用,无损分区软件哪个好
  20. AutoCAD常用快捷键

热门文章

  1. 不知道虚拟化?看这篇就够了!
  2. 【组队学习】【35期】组队学习内容详情
  3. Linux 自签名ssl证书生成
  4. 【OJ每日一练】1049 - 矩阵对角线元素之和 v1.0
  5. PC/UVa 题号: 110106/10033 Interpreter (解释器)题解 c语言版
  6. 爱奇艺、新英体育宣布成立合资公司,共造超级在线体育平台
  7. 洛谷P1757 通天之分组背包
  8. Build过程(objc)
  9. 谈一谈游戏AI - 行为树
  10. 分布式文件存储FASTDFS