Commit 14aa282e by leiliangliang

增加B站点赞,收藏,投币字段

parent de854d36
......@@ -132,6 +132,19 @@ public class HotSearchList implements Serializable{
* 标签(目前仅B站排行榜和知乎热搜使用)
*/
private String tag;
/**
* 点赞数(目前B站排行榜在用)
*/
private Long praiseCount;
/**
* 投币数(目前B站排行榜在用)
*/
private Long coinCount;
/**
* 收藏数(目前B站排行榜在用)
*/
private Long collectCount;
public HotSearchList(){}
public HotSearchList(String url, String name, Long count,Boolean hot,Integer rank,String type,String icon,Date date){
......
......@@ -62,10 +62,19 @@ public class BililiCrawler {
String bUrl = "https://www.bilibili.com/video/"+bvid;
Long view = null;
Long barrage = null;
//点赞数
Long praiseCount = null;
//投币数
Long coinCount = null;
//收藏数
Long collectCount = null;
if(data.containsKey("stat")) {
JSONObject stat = data.getJSONObject("stat");
view = stat.getLongValue("view");
barrage = stat.getLongValue("danmaku");
praiseCount = stat.getLongValue("like");
coinCount = stat.getLongValue("coin");
collectCount = stat.getLongValue("favorite");
}
//获取主持人
String downtext=null;
......@@ -75,6 +84,9 @@ public class BililiCrawler {
}
HotSearchList hotSearchList = new HotSearchList(bUrl,name,topicLead,count,null,date,rank,HotSearchType.B站排行榜.name(),view,barrage,pic);
hotSearchList.setDowntext(downtext);
hotSearchList.setPraiseCount(praiseCount);
hotSearchList.setCoinCount(coinCount);
hotSearchList.setCollectCount(collectCount);
executor.execute(new Runnable() {
@Override
public void run() {
......
......@@ -99,6 +99,9 @@ public class HotSearchCacheDAO {
document.put("tag", hotSearch.getTag());
document.put("downtext", hotSearch.getDowntext());
document.put("fans", hotSearch.getFans());
document.put("praiseCount", hotSearch.getPraiseCount());
document.put("coinCount", hotSearch.getCoinCount());
document.put("collectCount", hotSearch.getCollectCount());
}
if ("B站综合热门".equals(hotSearch.getType())) {
document.put("heatLabel", hotSearch.getHeatLabel());
......
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