Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
searchhotcrawler
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhiwei
searchhotcrawler
Commits
cd6d34ac
Commit
cd6d34ac
authored
Sep 15, 2022
by
leiliangliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微博信息新增文章具体链接
parent
50407ed7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
src/main/java/com/zhiwei/searchhotcrawler/bean/WeiBoMassage.java
+5
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
+4
-1
src/main/java/com/zhiwei/searchhotcrawler/dao/WeiBoMassageDao.java
+1
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/bean/WeiBoMassage.java
View file @
cd6d34ac
...
@@ -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
;
/**
/**
* 头像地址
* 头像地址
*/
*/
...
...
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
View file @
cd6d34ac
...
@@ -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
;
//微博实体 是否转发
//微博实体 是否转发
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/WeiBoMassageDao.java
View file @
cd6d34ac
...
@@ -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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment