Commit f51d3ad0 by leiliangliang

新增网易热榜主持人字段

parent ec44077d
...@@ -51,10 +51,12 @@ public class WangYiHotSearchCrawler { ...@@ -51,10 +51,12 @@ public class WangYiHotSearchCrawler {
for (int i = 0; i < jsonObject.size(); i++) { for (int i = 0; i < jsonObject.size(); i++) {
int rank = i + 1; int rank = i + 1;
String name = jsonObject.getJSONObject(i).getString("title"); String name = jsonObject.getJSONObject(i).getString("title");
String source = jsonObject.getJSONObject(i).getString("source");
long count = jsonObject.getJSONObject(i).getLongValue("hotValue"); long count = jsonObject.getJSONObject(i).getLongValue("hotValue");
String contentId = jsonObject.getJSONObject(i).getString("contentId"); String contentId = jsonObject.getJSONObject(i).getString("contentId");
String wangyiUrl = "https://c.m.163.com/news/a/" + contentId + ".html"; String wangyiUrl = "https://c.m.163.com/news/a/" + contentId + ".html";
HotSearchList hotSearchList = new HotSearchList(wangyiUrl, name, count, rank, HotSearchType.网易热榜.name(),date); HotSearchList hotSearchList = new HotSearchList(wangyiUrl, name, count, rank, HotSearchType.网易热榜.name(),date);
hotSearchList.setDowntext(source);
hotSearchLists.add(hotSearchList); hotSearchLists.add(hotSearchList);
} }
log.info("{}, 此轮网易新闻热榜采集到的数据量为:{}", new Date(), Integer.valueOf(hotSearchLists != null ? hotSearchLists.size() : 0)); log.info("{}, 此轮网易新闻热榜采集到的数据量为:{}", new Date(), Integer.valueOf(hotSearchLists != null ? hotSearchLists.size() : 0));
......
...@@ -81,6 +81,9 @@ public class HotSearchCacheDAO { ...@@ -81,6 +81,9 @@ public class HotSearchCacheDAO {
document.put("iconUrl", hotSearch.getIconUrl()); document.put("iconUrl", hotSearch.getIconUrl());
document.put("downtext", hotSearch.getDowntext()); document.put("downtext", hotSearch.getDowntext());
} }
if ("网易热榜".equals(hotSearch.getType())) {
document.put("downtext", hotSearch.getDowntext());
}
if ("百度热搜".equals(hotSearch.getType())) { if ("百度热搜".equals(hotSearch.getType())) {
document.put("topic_lead", hotSearch.getTopicLead()); document.put("topic_lead", hotSearch.getTopicLead());
} }
...@@ -101,6 +104,9 @@ public class HotSearchCacheDAO { ...@@ -101,6 +104,9 @@ public class HotSearchCacheDAO {
if ("微博要闻榜".equals(hotSearch.getType())) { if ("微博要闻榜".equals(hotSearch.getType())) {
document.remove("downtext"); document.remove("downtext");
} }
if ("网易热榜".equals(hotSearch.getType())) {
document.remove("downtext");
}
dataes.add(document); dataes.add(document);
} }
return dataes; return dataes;
...@@ -254,6 +260,9 @@ public class HotSearchCacheDAO { ...@@ -254,6 +260,9 @@ public class HotSearchCacheDAO {
nowDoc.put("downtext", document.getString("downtext")); nowDoc.put("downtext", document.getString("downtext"));
nowDoc.put("comment_count", document.getLong("comment_count")); nowDoc.put("comment_count", document.getLong("comment_count"));
} }
if ("网易热榜".equals(type)) {
nowDoc.put("downtext", document.getString("downtext"));
}
if (topicResult != null) { if (topicResult != null) {
nowDoc.put("topicResult", topicResult); nowDoc.put("topicResult", topicResult);
} }
......
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