Commit 51a4bfa2 by chenweitao

Merge remote-tracking branch 'origin/working' into working

parents d9567459 71498213
......@@ -57,14 +57,16 @@ public class WeiboEntertainmentCrawler {
JSONObject cardInfo = cardGroup.getJSONObject(j);
String name = cardInfo.getString("desc");
long hotCount = cardInfo.getLongValue("desc_extr");
String icon = cardInfo.getString("icon");
if (StringUtils.isNotBlank(icon)) {
icon = icon.split("_")[1].split(".png")[0];
String iconUrl = cardInfo.getString("icon");
String icon =null;
if (StringUtils.isNotBlank(iconUrl)) {
icon = iconUrl.split("_")[1].split(".png")[0];
}
String id = cardInfo.getString("scheme");
String ul="https://m.weibo.cn/search?"+id.split( "[?]")[1];
rank++;
HotSearchList hotSearch = new HotSearchList(ul, name, hotCount, hot, rank, HotSearchType.微博娱乐榜.name(), icon, date);
if (Objects.nonNull(iconUrl)){hotSearch.setIconUrl(iconUrl);}
if(!"娱乐动态数据详情".equals(hotSearch.getName())){
result.add(hotSearch);
}
......
......@@ -53,6 +53,9 @@ public class HotSearchCacheDAO {
if("微博热搜".equals(hotSearch.getType())){
document.put("iconUrl", hotSearch.getIconUrl());
}
if("微博娱乐榜".equals(hotSearch.getType())){
document.put("iconUrl", hotSearch.getIconUrl());
}
// if("今日头条热搜".equals(hotSearch.getType())){
// document.put("comment_count", hotSearch.getCommentCount());
// }
......
......@@ -57,14 +57,16 @@ public class WeiboEntertainmentCrawlerTest {
JSONObject cardInfo = cardGroup.getJSONObject(j);
String name = cardInfo.getString("desc");
long hotCount = cardInfo.getLongValue("desc_extr");
String icon = cardInfo.getString("icon");
if (StringUtils.isNotBlank(icon)) {
icon = icon.split("_")[1].split(".png")[0];
String iconUrl = cardInfo.getString("icon");
String icon =null;
if (StringUtils.isNotBlank(iconUrl)) {
icon = iconUrl.split("_")[1].split(".png")[0];
}
String id = cardInfo.getString("scheme");
String ul="https://m.weibo.cn/search?"+id.split( "[?]")[1];
rank++;
HotSearchList hotSearch = new HotSearchList(ul, name, hotCount, hot, rank, HotSearchType.微博娱乐榜.name(), icon, date);
if (Objects.nonNull(iconUrl)){hotSearch.setIconUrl(iconUrl);}
if(!"娱乐动态数据详情".equals(hotSearch.getName())){
result.add(hotSearch);
}
......
......@@ -10,7 +10,6 @@ import com.zhiwei.searchhotcrawler.dao.RedisDao;
import com.zhiwei.searchhotcrawler.dao.WeiboSuperTopicDAO;
import com.zhiwei.searchhotcrawler.crawler.HotSearch36KrCrawler;
import com.zhiwei.searchhotcrawler.crawler.HuXiuHotSearchCrawler;
import com.zhiwei.searchhotcrawler.test.DouYinTongChengCrawlerTest;
import com.zhiwei.searchhotcrawler.timer.TouTiaoExecutor;
import com.zhiwei.searchhotcrawler.util.DateUtils;
import com.zhiwei.searchhotcrawler.util.TipsUtils;
......
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