Commit 15038a17 by chenweitao

Merge branch 'working' into 'master'

新增网易热榜主持人字段

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