Commit d6f4e440 by zhiwei

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

parent b7e91b0a
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
<dependency> <dependency>
<groupId>com.zhiwei.crawler</groupId> <groupId>com.zhiwei.crawler</groupId>
<artifactId>crawler-core</artifactId> <artifactId>crawler-core</artifactId>
<version>0.3.6-RELEASE</version> <version>0.5.2-RELEASE</version>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -77,6 +77,8 @@ public class UrlLiveBean { ...@@ -77,6 +77,8 @@ public class UrlLiveBean {
private Integer count; private Integer count;
private Integer code;
/** /**
* Constructor * Constructor
* *
...@@ -92,6 +94,12 @@ public class UrlLiveBean { ...@@ -92,6 +94,12 @@ public class UrlLiveBean {
* @param attr * @param attr
* @param count * @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){ private Attribution(Object attr,Integer count){
this.attr = attr; this.attr = attr;
this.count = count; this.count = count;
...@@ -114,7 +122,11 @@ public class UrlLiveBean { ...@@ -114,7 +122,11 @@ public class UrlLiveBean {
* @return Attribution * @return Attribution
*/ */
public static Attribution of(Object attr,Integer count) { 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 { ...@@ -135,7 +147,11 @@ public class UrlLiveBean {
return count; return count;
} }
public void AddCount() { public Integer getCode() {
return code;
}
public void addCount() {
count++; count++;
} }
} }
......
...@@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger; ...@@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger;
import com.zhiwei.common.config.GroupType; import com.zhiwei.common.config.GroupType;
import com.zhiwei.crawler.proxy.ProxyFactory; 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;
import com.zhiwei.source_forward.bean.UrlLiveBean.Attribution; import com.zhiwei.source_forward.bean.UrlLiveBean.Attribution;
import com.zhiwei.source_forward.crawler.UrlLiveCrawler; import com.zhiwei.source_forward.crawler.UrlLiveCrawler;
...@@ -74,8 +75,7 @@ public class URLLive { ...@@ -74,8 +75,7 @@ public class URLLive {
public static void main(String[] args) { public static void main(String[] args) {
ProxyFactory.init("zookeeper://192.168.0.36:2181","local",GroupType.PROVIDER); ProxyFactory.init("zookeeper://192.168.0.36:2181","local",GroupType.PROVIDER);
List<String> urlList = new ArrayList<>(); 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); List<UrlLiveBean> u = URLLive.verificationURLLive(urlList);
for(UrlLiveBean b : u) { 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