Commit e07e6507 by leiliangliang

新增微博要闻榜采集功能

parent 8ec17aa9
...@@ -113,6 +113,11 @@ public class HotSearchList implements Serializable{ ...@@ -113,6 +113,11 @@ public class HotSearchList implements Serializable{
**/ **/
private String rankPic; private String rankPic;
/**
* 主持人
*/
private String downtext;
public HotSearchList(){} public HotSearchList(){}
public HotSearchList(String url, String name, Long count,Boolean hot,Integer rank,String type,String icon,Date date){ public HotSearchList(String url, String name, Long count,Boolean hot,Integer rank,String type,String icon,Date date){
......
...@@ -29,5 +29,6 @@ public enum HotSearchType { ...@@ -29,5 +29,6 @@ public enum HotSearchType {
淘宝热搜, 淘宝热搜,
抖音同城榜, 抖音同城榜,
微博娱乐榜, 微博娱乐榜,
微博要闻榜,
} }
...@@ -63,6 +63,11 @@ public class HotSearchCacheDAO { ...@@ -63,6 +63,11 @@ public class HotSearchCacheDAO {
if("虎嗅热文推荐".equals(hotSearch.getType())){ if("虎嗅热文推荐".equals(hotSearch.getType())){
document.put("comment_count", hotSearch.getCommentCount()); document.put("comment_count", hotSearch.getCommentCount());
} }
if("微博要闻榜".equals(hotSearch.getType())){
document.put("comment_count", hotSearch.getCommentCount());
document.put("iconUrl", hotSearch.getIconUrl());
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());
} }
...@@ -80,6 +85,9 @@ public class HotSearchCacheDAO { ...@@ -80,6 +85,9 @@ public class HotSearchCacheDAO {
if("百度热搜".equals(hotSearch.getType())){ if("百度热搜".equals(hotSearch.getType())){
document.remove("topic_lead"); document.remove("topic_lead");
} }
if("微博要闻榜".equals(hotSearch.getType())){
document.remove("downtext");
}
dataes.add(document); dataes.add(document);
}); });
return dataes; return dataes;
...@@ -210,7 +218,10 @@ public class HotSearchCacheDAO { ...@@ -210,7 +218,10 @@ public class HotSearchCacheDAO {
if("虎嗅热文推荐".equals(type)){ if("虎嗅热文推荐".equals(type)){
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"));
nowDoc.put("comment_count",document.getLong("comment_count"));
}
if(topicResult != null){ if(topicResult != null){
nowDoc.put("topicResult",topicResult); nowDoc.put("topicResult",topicResult);
} }
......
...@@ -588,4 +588,17 @@ public class GatherTimer { ...@@ -588,4 +588,17 @@ public class GatherTimer {
TipsUtils.addHotList(HotSearchType.微博娱乐榜.name(), weiBoEntertainmentList); TipsUtils.addHotList(HotSearchType.微博娱乐榜.name(), weiBoEntertainmentList);
logger.info("微博娱乐榜采集结束..."); logger.info("微博娱乐榜采集结束...");
} }
/**
*微博娱乐榜采集
*/
@Async(value = "myScheduler")
@Scheduled(cron = "0 * * * * ? ")
public void crawlerWeiBoNews(){
logger.info("微博要闻榜开始采集...");
Date date = DateUtils.getMillSecondTime(new Date());
List<HotSearchList> WeiboNewsList = WeiboNewsCrawler.weiboNewsByPhone(date);
logger.info("{}, 微博要闻榜此轮采集到的数据量为:{}", new Date(), WeiboNewsList != null ? WeiboNewsList.size() : 0);
TipsUtils.addHotList(HotSearchType.微博要闻榜.name(), WeiboNewsList);
logger.info("微博要闻榜采集结束...");
}
} }
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