Commit ead257cb by 马黎滨

主持人采集

parent 8b9f767a
...@@ -108,6 +108,11 @@ public class HotSearchCache { ...@@ -108,6 +108,11 @@ public class HotSearchCache {
*/ */
private double riseSpeed; private double riseSpeed;
/**
* 主持人
*/
private String downtext;
public HotSearchCache(String url, String name, String topicLead, Integer highestCount, Integer lastCount, Boolean hot, public HotSearchCache(String url, String name, String topicLead, Integer highestCount, Integer lastCount, Boolean hot,
Date startTime, Date endTime, Integer highestRank, Integer lastRank, String type, Integer duration){ Date startTime, Date endTime, Integer highestRank, Integer lastRank, String type, Integer duration){
this.id = name + "_" + type; this.id = name + "_" + type;
......
...@@ -258,6 +258,12 @@ public class WeiboHotSearchCrawler { ...@@ -258,6 +258,12 @@ public class WeiboHotSearchCrawler {
document.put("readCount", TipsUtils.getHotCount(read)); document.put("readCount", TipsUtils.getHotCount(read));
document.put("discussCount", TipsUtils.getHotCount(discussCount)); document.put("discussCount", TipsUtils.getHotCount(discussCount));
document.put("pictureUrl",pictureUrl); document.put("pictureUrl",pictureUrl);
if (readJson.getJSONObject("head_data").containsKey("downtext")){
String downtext = readJson.getJSONObject("head_data").getString("downtext");
if(!"".equals(downtext)) {
document.put("downtext",downtext.replaceAll("主持人:",""));
}
}
} }
} }
return document; return document;
......
...@@ -197,6 +197,9 @@ public class HotSearchCacheDAO { ...@@ -197,6 +197,9 @@ public class HotSearchCacheDAO {
if (nowDoc.containsKey("pictureUrl")) { if (nowDoc.containsKey("pictureUrl")) {
nowDoc.put("pictureUrl",nowDoc.getString("pictureUrl")); nowDoc.put("pictureUrl",nowDoc.getString("pictureUrl"));
} }
if (nowDoc.containsKey("downtext")) {
nowDoc.put("downtext",nowDoc.getString("downtext"));
}
} }
collection.insertOne(nowDoc); collection.insertOne(nowDoc);
} }
...@@ -342,6 +345,9 @@ public class HotSearchCacheDAO { ...@@ -342,6 +345,9 @@ public class HotSearchCacheDAO {
if(document.containsKey("pictureUrl")){ if(document.containsKey("pictureUrl")){
nowDoc.put("pictureUrl",document.getString("pictureUrl")); nowDoc.put("pictureUrl",document.getString("pictureUrl"));
} }
if (Objects.isNull(nowDoc.get("downtext")) && document.containsKey("downtext")){
nowDoc.put("downtext",document.getString("downtext"));
}
collection.replaceOne(query, nowDoc); collection.replaceOne(query, nowDoc);
} }
} }
......
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