Commit e3740064 by chenweitao

Merge branch 'working' into 'master'

Working

See merge request !97
parents 64992203 241bc05a
......@@ -99,6 +99,11 @@ public class HotSearchList implements Serializable{
*/
private String pictureUrl;
/**
* 图片排位
**/
private String rankPic;
public HotSearchList(){}
public HotSearchList(String url, String name, Long count,Boolean hot,Integer rank,String type,String icon,Date date){
......
......@@ -162,9 +162,12 @@ public class WeiboHotSearchCrawler {
if (StringUtils.isNotBlank(icon)) {
icon = icon.split("_")[1].split(".png")[0];
}
String rankPic = cardInfo.getString("pic");
// String id = "http://s.weibo.com/weibo/" + URLCodeUtil.getURLEncode(name, "utf-8") + "&Refer=top";
String id = cardInfo.getString("scheme");
HotSearchList hotSearch = new HotSearchList(id, name, hotCount, hot, rank, HotSearchType.微博热搜.name(), icon, date);
String urlScheme = cardInfo.getString("scheme");
HotSearchList hotSearch = new HotSearchList(urlScheme, name, hotCount, hot, rank, HotSearchType.微博热搜.name(), icon, date);
hotSearch.setRankPic(rankPic);
result.add(hotSearch);
rank++;
redisDao.addDataToSet(RedisConfig.WEIBO_HOTSEARCHIDS,name+"_微博热搜");
......
......@@ -43,6 +43,7 @@ public class HotSearchCacheDAO {
document.put("rank", hotSearch.getRank());
document.put("type", hotSearch.getType());
document.put("icon", hotSearch.getIcon());
document.put("rankPic", hotSearch.getRankPic());
if("微博话题".equals(hotSearch.getType())){
document.put("topic_lead", hotSearch.getTopicLead());
document.put("comment_count", hotSearch.getCommentCount());
......@@ -100,6 +101,12 @@ public class HotSearchCacheDAO {
boolean recommend = false;
// Integer readCount = document.getInteger("comment_count");
if("微博热搜".equals(type)){
//排位标判断 例如 https://simg.s.weibo.com/20210408_search_point_orange.png
String rankPic = document.getString("rankPic");
if (nonNull(rankPic)&&rankPic.contains("search_point")){
recommend = true;
}
//后标判断
String icon = document.getString("icon");
if("recom".equals(icon) || "jian".equals(icon)){
recommend = true;
......
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