Commit cd6d34ac by leiliangliang

微博信息新增文章具体链接

parent 50407ed7
...@@ -88,6 +88,11 @@ public class WeiBoMassage implements Serializable { ...@@ -88,6 +88,11 @@ public class WeiBoMassage implements Serializable {
* 话题 * 话题
*/ */
private String topic; private String topic;
/**
* 具体文章链接
*/
private String articleLink;
/** /**
* 头像地址 * 头像地址
*/ */
......
...@@ -768,6 +768,7 @@ public class WeiboHotSearchCrawler { ...@@ -768,6 +768,7 @@ public class WeiboHotSearchCrawler {
} }
String mid = mblog.getString("mid"); String mid = mblog.getString("mid");
String bid = mblog.getString("bid");
//用户id //用户id
String userId = mblog.getJSONObject("user").getString("id"); String userId = mblog.getJSONObject("user").getString("id");
//用户名 //用户名
...@@ -786,11 +787,13 @@ public class WeiboHotSearchCrawler { ...@@ -786,11 +787,13 @@ public class WeiboHotSearchCrawler {
} else { } else {
content = mblog.getString("text"); content = mblog.getString("text");
} }
//具体文章链接
String articleLink="https://weibo.com/"+userId+"/"+bid;
weiBoMassage = new WeiBoMassage(userId, content, userName, mid, createTime, editTime, cardType, showType, weiBoMassage = new WeiBoMassage(userId, content, userName, mid, createTime, editTime, cardType, showType,
repostCount, commentCount, attitudeCount, source, type, topic, profileImageUrl); repostCount, commentCount, attitudeCount, source, type, topic, profileImageUrl);
//默认不转发为0 //默认不转发为0
weiBoMassage.setForward(0); weiBoMassage.setForward(0);
weiBoMassage.setArticleLink(articleLink);
JSONObject weiboJson = null; JSONObject weiboJson = null;
//微博实体 是否转发 //微博实体 是否转发
......
...@@ -60,6 +60,7 @@ public class WeiBoMassageDao { ...@@ -60,6 +60,7 @@ public class WeiBoMassageDao {
document.put("type",weiBoMassage.getType()); document.put("type",weiBoMassage.getType());
document.put("topic",weiBoMassage.getTopic()); document.put("topic",weiBoMassage.getTopic());
document.put("forward",weiBoMassage.getForward()); document.put("forward",weiBoMassage.getForward());
document.put("articleLink",weiBoMassage.getArticleLink());
if (0!=weiBoMassage.getForward()){ if (0!=weiBoMassage.getForward()){
document.put("root_mid",weiBoMassage.getRoot_mid()); document.put("root_mid",weiBoMassage.getRoot_mid());
document.put("root_id",weiBoMassage.getRoot_id()); document.put("root_id",weiBoMassage.getRoot_id());
......
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