Commit 2d81b0b1 by chenweitao

Merge branch 'working' into 'master'

Working

See merge request !131
parents d431fc6a f6691b98
...@@ -169,14 +169,22 @@ public class WeiboHotSearchCrawler { ...@@ -169,14 +169,22 @@ public class WeiboHotSearchCrawler {
String name = cardInfo.getString("desc"); String name = cardInfo.getString("desc");
String desc_extr = cardInfo.getString("desc_extr"); String desc_extr = cardInfo.getString("desc_extr");
String heatLabel=null; String heatLabel=null;
Long hotCount =null; Long hotCount =0L;
if (!StringUtils.isEmpty(desc_extr)&&Objects.nonNull(desc_extr)){ if (!StringUtils.isEmpty(desc_extr)&&Objects.nonNull(desc_extr)){
String regEx="[^0-9]"; String regEx="[^0-9]";
Pattern p = Pattern.compile(regEx); Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(desc_extr); Matcher m = p.matcher(desc_extr);
String num = m.replaceAll("").trim(); String num = m.replaceAll("").trim();
hotCount = Long.valueOf(num); hotCount = Long.valueOf(num);
heatLabel= desc_extr.split(" ")[0]; String[] split = desc_extr.split(" ");
if (split.length>1){
String heat= split[0].trim();
boolean flag = StringUtils.isNumeric(heat);
if (!flag){
heatLabel= split[0].trim();
}
}
} }
String iconUrl = cardInfo.getString("icon"); String iconUrl = cardInfo.getString("icon");
String icon=null; String icon=null;
......
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