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
a70278ba
Commit
a70278ba
authored
Jul 12, 2021
by
leiliangliang
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增微博话题采集话题贡献者,关于功能
parent
7e156432
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
2 deletions
+4
-2
src/main/java/com/zhiwei/searchhotcrawler/bean/WeiBoUser.java
+1
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
+0
-2
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+1
-0
src/main/java/com/zhiwei/searchhotcrawler/dao/WeiBoUserDao.java
+2
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/bean/WeiBoUser.java
View file @
a70278ba
...
@@ -61,6 +61,7 @@ public class WeiBoUser implements Serializable {
...
@@ -61,6 +61,7 @@ public class WeiBoUser implements Serializable {
public
WeiBoUser
()
{
public
WeiBoUser
()
{
}
}
public
WeiBoUser
(
String
userId
,
String
attestationMassage
,
String
userName
,
String
topic
,
Date
time
,
Long
followerCount
,
String
profileImageUrl
)
{
public
WeiBoUser
(
String
userId
,
String
attestationMassage
,
String
userName
,
String
topic
,
Date
time
,
Long
followerCount
,
String
profileImageUrl
)
{
this
.
id
=
userId
+
"_"
+
HotSearchType
.
微博热搜
.
name
()+
"_"
+
topic
;
this
.
id
=
userId
+
"_"
+
HotSearchType
.
微博热搜
.
name
()+
"_"
+
topic
;
...
...
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
View file @
a70278ba
...
@@ -381,7 +381,6 @@ public class WeiboHotSearchCrawler {
...
@@ -381,7 +381,6 @@ public class WeiboHotSearchCrawler {
}
}
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"话题贡献者排行采集异常"
,
e
);
log
.
error
(
"话题贡献者排行采集异常"
,
e
);
}
}
...
@@ -437,7 +436,6 @@ public class WeiboHotSearchCrawler {
...
@@ -437,7 +436,6 @@ public class WeiboHotSearchCrawler {
weiBoUser
.
setType
(
type
);
weiBoUser
.
setType
(
type
);
weiBoUser
.
setId
(
id
);
weiBoUser
.
setId
(
id
);
weiBoUserDao
.
addWeiBoUser
(
weiBoUser
);
weiBoUserDao
.
addWeiBoUser
(
weiBoUser
);
}
}
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
a70278ba
...
@@ -208,6 +208,7 @@ public class HotSearchCacheDAO {
...
@@ -208,6 +208,7 @@ public class HotSearchCacheDAO {
}
}
if
(
"微博热搜"
.
equals
(
type
)){
if
(
"微博热搜"
.
equals
(
type
)){
nowDoc
=
WeiboHotSearchCrawler
.
weiboUpdate
(
nowDoc
);
nowDoc
=
WeiboHotSearchCrawler
.
weiboUpdate
(
nowDoc
);
//更新微博话题贡献者,关于功能
Document
documentPC
=
WeiboHotSearchCrawler
.
weiboUpdatePC
(
nowDoc
);
Document
documentPC
=
WeiboHotSearchCrawler
.
weiboUpdatePC
(
nowDoc
);
if
(
documentPC
.
containsKey
(
"分类"
))
{
if
(
documentPC
.
containsKey
(
"分类"
))
{
nowDoc
.
put
(
"classify"
,
documentPC
.
get
(
"分类"
));
nowDoc
.
put
(
"classify"
,
documentPC
.
get
(
"分类"
));
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/WeiBoUserDao.java
View file @
a70278ba
...
@@ -45,12 +45,14 @@ public class WeiBoUserDao {
...
@@ -45,12 +45,14 @@ public class WeiBoUserDao {
if
(
Objects
.
nonNull
(
weiBoUser
.
getType
())){
if
(
Objects
.
nonNull
(
weiBoUser
.
getType
())){
document
.
put
(
"type"
,
weiBoUser
.
getType
());
document
.
put
(
"type"
,
weiBoUser
.
getType
());
}
}
if
(
Objects
.
nonNull
(
weiBoUser
.
getFollowerCount
())){
if
(
Objects
.
nonNull
(
weiBoUser
.
getFollowerCount
())){
document
.
put
(
"followerCount"
,
weiBoUser
.
getFollowerCount
());
document
.
put
(
"followerCount"
,
weiBoUser
.
getFollowerCount
());
}
}
if
(
Objects
.
nonNull
(
weiBoUser
.
getProfileImageUrl
())){
if
(
Objects
.
nonNull
(
weiBoUser
.
getProfileImageUrl
())){
document
.
put
(
"profileImageUrl"
,
weiBoUser
.
getProfileImageUrl
());
document
.
put
(
"profileImageUrl"
,
weiBoUser
.
getProfileImageUrl
());
}
}
try
{
try
{
mongoCollection
.
insertOne
(
document
);
mongoCollection
.
insertOne
(
document
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
chenweitao
@chenweitao
mentioned in commit
bac55393
Jul 12, 2021
mentioned in commit
bac55393
mentioned in commit bac553937e213aa7aa84fbef8a59f60382afe175
Toggle commit list
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