Commit d6f4e440 by zhiwei

验证是否删除添加知乎验证

parent b7e91b0a
......@@ -29,8 +29,7 @@
<dependency>
<groupId>com.zhiwei.crawler</groupId>
<artifactId>crawler-core</artifactId>
<version>0.3.6-RELEASE</version>
<scope>provided</scope>
<version>0.5.2-RELEASE</version>
</dependency>
</dependencies>
......
......@@ -77,6 +77,8 @@ public class UrlLiveBean {
private Integer count;
private Integer code;
/**
* Constructor
*
......@@ -92,6 +94,12 @@ public class UrlLiveBean {
* @param attr
* @param count
*/
private Attribution(Object attr,Integer count, Integer code){
this.attr = attr;
this.count = count;
this.code = code;
}
private Attribution(Object attr,Integer count){
this.attr = attr;
this.count = count;
......@@ -114,7 +122,11 @@ public class UrlLiveBean {
* @return Attribution
*/
public static Attribution of(Object attr,Integer count) {
return new Attribution(attr,count);
return new Attribution(attr, count);
}
public static Attribution of(Object attr,Integer count,Integer code) {
return new Attribution(attr, count, code);
}
/**
......@@ -135,7 +147,11 @@ public class UrlLiveBean {
return count;
}
public void AddCount() {
public Integer getCode() {
return code;
}
public void addCount() {
count++;
}
}
......
......@@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger;
import com.zhiwei.common.config.GroupType;
import com.zhiwei.crawler.proxy.ProxyFactory;
import com.zhiwei.crawler.proxy.ProxyHolder;
import com.zhiwei.source_forward.bean.UrlLiveBean;
import com.zhiwei.source_forward.bean.UrlLiveBean.Attribution;
import com.zhiwei.source_forward.crawler.UrlLiveCrawler;
......@@ -74,8 +75,7 @@ public class URLLive {
public static void main(String[] args) {
ProxyFactory.init("zookeeper://192.168.0.36:2181","local",GroupType.PROVIDER);
List<String> urlList = new ArrayList<>();
urlList.add("http://www.ebrun.com/ebrungo/zb/316384.shtml");
urlList.add("https://www.zhihu.com/question/340524333");
List<UrlLiveBean> u = URLLive.verificationURLLive(urlList);
for(UrlLiveBean b : u) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment