Commit 355e6754 by chenweitao

Merge branch 'mlbWork' into 'master'

Mlb work

See merge request !68
parents 98f0116b 84ce86e8
......@@ -58,7 +58,13 @@ public class XinLangHotSearchCrawler {
Integer rank = i + 1;
String hotValue = jsonArray.getJSONObject(i).getString("hotValue");
Integer count = TipsUtils.getHotCount(hotValue);
String showTags = jsonArray.getJSONObject(i).getString("showTags");
String showTags;
if (jsonArray.getJSONObject(i).containsKey("card")){
JSONArray cardArray = jsonArray.getJSONObject(i).getJSONArray("card");
showTags= cardArray.getJSONObject(0).getString("showTags");
}else {
showTags = jsonArray.getJSONObject(i).getString("showTags");
}
String routeUri = jsonArray.getJSONObject(i).getString("routeUri");
String xinLangUrl = null;
if (routeUri.contains("groupId")) {
......@@ -68,6 +74,7 @@ public class XinLangHotSearchCrawler {
xinLangUrl = "https://m.so.com/s?q="+ URLCodeUtil.getURLEncode(name, "utf-8")+"&src=dfttrc&srcg=sina_shoulang_act";
}
String icon = null;
if(Objects.nonNull(showTags)) {
if (showTags.contains("新")) {
icon = "新";
} else if (showTags.contains("热")) {
......@@ -75,6 +82,7 @@ public class XinLangHotSearchCrawler {
} else if (showTags.contains("沸")) {
icon = "沸";
}
}
HotSearchList hotSearchList = new HotSearchList(xinLangUrl, name, count, true, rank, HotSearchType.新浪热榜.name(), icon, date);
hotSearchLists.add(hotSearchList);
}
......
......@@ -329,6 +329,9 @@ public class HotSearchCacheDAO {
nowDoc.put("readCount", document.getInteger("readCount"));
nowDoc.put("discussCount", document.getInteger("discussCount"));
}
if(document.containsKey("pictureUrl")){
nowDoc.put("pictureUrl",document.getString("pictureUrl"));
}
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