Commit a71c606b by yangchen

链接是否删除 修改

parent 37ac4e23
......@@ -6,6 +6,8 @@ public class UrlLiveBean {
private Integer isLive;
private String title;
public UrlLiveBean() {
super();
}
......@@ -16,9 +18,17 @@ public class UrlLiveBean {
this.isLive = isLive;
}
public UrlLiveBean(String url, boolean isLive) {
public UrlLiveBean(String url, Integer isLive,String title) {
super();
this.url = url;
this.isLive = isLive;
this.title = title;
}
public UrlLiveBean(String url, boolean isLive,String title) {
super();
this.url = url;
this.title = title;
if(isLive) {
this.isLive = 1; //已删除
}else {
......@@ -26,6 +36,14 @@ public class UrlLiveBean {
}
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUrl() {
return url;
}
......@@ -44,7 +62,8 @@ public class UrlLiveBean {
@Override
public String toString() {
return "UrlLiveBean [url=" + url + ", isLive=" + isLive + "]";
return "UrlLiveBean [url=" + url + ", isLive=" + isLive + ", title="
+ title + "]";
}
/**
......
package com.zhiwei.source_forward.run;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.zhiwei.common.config.GroupType;
import com.zhiwei.crawler.core.HttpBoot;
import com.zhiwei.crawler.core.RequestUtils;
import com.zhiwei.crawler.proxy.ProxyFactory;
import com.zhiwei.source_forward.bean.UrlLiveBean;
import com.zhiwei.source_forward.bean.UrlLiveBean.Attribution;
import com.zhiwei.source_forward.crawler.UrlLiveCrawler;
......@@ -46,6 +51,7 @@ public class URLLive {
}else if(i == 0) {
map.put("是否删除", false);
}
map.put("title", ub.getTitle());
dataMap.put(url, map);
}
}
......@@ -60,13 +66,15 @@ public class URLLive {
*/
public static List<UrlLiveBean> verificationURLLive(List<String> urlList){
//启动验证链接是否有效程序程序
List<UrlLiveBean> dataList = UrlLiveCrawlerThread.getUrlLiveCrawle(urlList);
return dataList;
return UrlLiveCrawlerThread.getUrlLiveCrawle(urlList);
}
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.teso.cc/html/zixun/201606/233848.html");
urlList.add("https://www.hao123.com/mid/16981890690654602094");
List<UrlLiveBean> u = URLLive.verificationURLLive(urlList);
for(UrlLiveBean b : u) {
System.out.println(b.toString());
......
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