Commit 706e02e0 by zhiwei

删除无用的log及修改主键组合方式,添加微博话题采集

parent 5250248e
...@@ -87,7 +87,7 @@ public class HotSearchList implements Serializable{ ...@@ -87,7 +87,7 @@ public class HotSearchList implements Serializable{
public HotSearchList(){} public HotSearchList(){}
public HotSearchList(String url, String name, Integer count,Boolean hot,Integer rank,String type,String icon){ public HotSearchList(String url, String name, Integer count,Boolean hot,Integer rank,String type,String icon){
this.id = name + "_" + new Date().getTime(); this.id = name + "_" + new Date().getTime() + "_" + type;
this.url = url; this.url = url;
this.name = name; this.name = name;
this.count = count; this.count = count;
...@@ -101,7 +101,7 @@ public class HotSearchList implements Serializable{ ...@@ -101,7 +101,7 @@ public class HotSearchList implements Serializable{
public HotSearchList(String url, String name, Integer count,Integer rank,String type){ public HotSearchList(String url, String name, Integer count,Integer rank,String type){
this.id = name + "_" + new Date().getTime(); this.id = name + "_" + new Date().getTime()+ "_" + type;
this.url = url; this.url = url;
this.name = name; this.name = name;
this.count = count; this.count = count;
...@@ -114,7 +114,7 @@ public class HotSearchList implements Serializable{ ...@@ -114,7 +114,7 @@ public class HotSearchList implements Serializable{
public HotSearchList(String url, String name, Integer count,Integer rank,String type, Integer commentCount, String topicLead){ public HotSearchList(String url, String name, Integer count,Integer rank,String type, Integer commentCount, String topicLead){
this.id = name + "_" + new Date().getTime(); this.id = name + "_" + new Date().getTime()+ "_" + type;
this.url = url; this.url = url;
this.name = name; this.name = name;
this.count = count; this.count = count;
......
...@@ -139,7 +139,6 @@ public class WeiboHotSearchCrawler { ...@@ -139,7 +139,6 @@ public class WeiboHotSearchCrawler {
} }
String id = "http://s.weibo.com/weibo/"+URLCodeUtil.getURLEncode(name, "utf-8") + "&Refer=top"; String id = "http://s.weibo.com/weibo/"+URLCodeUtil.getURLEncode(name, "utf-8") + "&Refer=top";
HotSearchList hotSearch = new HotSearchList(id, name, hotCount, hot, rank, HotSearchType.微博热搜.name(), icon); HotSearchList hotSearch = new HotSearchList(id, name, hotCount, hot, rank, HotSearchType.微博热搜.name(), icon);
log.info("采集到的数据:::{}", hotSearch);
result.add(hotSearch); result.add(hotSearch);
rank++; rank++;
} }
......
...@@ -114,7 +114,6 @@ public class WeiboSuperTopicCrawler { ...@@ -114,7 +114,6 @@ public class WeiboSuperTopicCrawler {
WeiboSuperTopic topic = new WeiboSuperTopic(url, topicName, toprank, score, fensi, type); WeiboSuperTopic topic = new WeiboSuperTopic(url, topicName, toprank, score, fensi, type);
topic = getTopicInfo(id, topic); topic = getTopicInfo(id, topic);
System.out.println("topic====="+topic);
topicList.add(topic); topicList.add(topic);
} }
return topicList; return topicList;
......
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