Commit c9795aca by shentao

2018/11/20 事件采集url去除百度的跳转链接

parent ed96a533
......@@ -37,6 +37,7 @@ import com.zhiwei.messageflow.bean.Event;
import com.zhiwei.messageflow.config.MiddlewareConfig;
import com.zhiwei.messageflow.redis.service.RedisService;
import com.zhiwei.messageflow.service.EventService;
import com.zhiwei.messageflow.util.Tools;
import com.zhiwei.middleware.automaticmark.Service.AutomaticMarkClient;
import redis.clients.jedis.Tuple;
......@@ -171,13 +172,11 @@ public class EventServiceImpl implements EventService {
private boolean CanMsgInsert(JSONObject msgJsonOb) {
if (msgJsonOb.containsKey("time")) {
if (null == msgJsonOb.getLong("time") || -1 == msgJsonOb.getLong("time")) {
// log.info("MSG_time_Error:{}", msgJsonOb);
return false;
}
}
if (msgJsonOb.containsKey("source")) {
if (null == msgJsonOb.getString("source") || "百度网页".equals(msgJsonOb.getString("source"))) {
// log.info("MSG_Source_Error:{}", msgJsonOb);
return false;
}
}
......@@ -194,6 +193,9 @@ public class EventServiceImpl implements EventService {
} else if (!isValidUrl(msgJsonOb.getString("url"))) {
log.info("MSG_url_Error_notValid:{}", msgJsonOb);
return false;
} else if (Tools.approximateStringMatching(msgJsonOb.getString("url"),"www.baidu.com/link?url=")) {
log.info("MSG_url_Error_www.baidu.com/link?url=:{}", msgJsonOb);
return false;
}
}
if (msgJsonOb.containsKey("content")) {
......
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