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
3e5c72ea
Commit
3e5c72ea
authored
Sep 30, 2021
by
chenweitao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'working' into 'master'
新增微博要闻榜采集功能 See merge request
!136
parents
172e5b3c
e07e6507
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
1 deletions
+31
-1
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchList.java
+5
-0
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchType.java
+1
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboNewsCrawler.java
+0
-0
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+12
-1
src/main/java/com/zhiwei/searchhotcrawler/timer/quartz/GatherTimer.java
+13
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchList.java
View file @
3e5c72ea
...
...
@@ -113,6 +113,11 @@ public class HotSearchList implements Serializable{
**/
private
String
rankPic
;
/**
* 主持人
*/
private
String
downtext
;
public
HotSearchList
(){}
public
HotSearchList
(
String
url
,
String
name
,
Long
count
,
Boolean
hot
,
Integer
rank
,
String
type
,
String
icon
,
Date
date
){
...
...
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchType.java
View file @
3e5c72ea
...
...
@@ -29,5 +29,6 @@ public enum HotSearchType {
淘宝热搜
,
抖音同城榜
,
微博娱乐榜
,
微博要闻榜
,
}
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboNewsCrawler.java
0 → 100644
View file @
3e5c72ea
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
3e5c72ea
...
...
@@ -63,6 +63,11 @@ public class HotSearchCacheDAO {
if
(
"虎嗅热文推荐"
.
equals
(
hotSearch
.
getType
())){
document
.
put
(
"comment_count"
,
hotSearch
.
getCommentCount
());
}
if
(
"微博要闻榜"
.
equals
(
hotSearch
.
getType
())){
document
.
put
(
"comment_count"
,
hotSearch
.
getCommentCount
());
document
.
put
(
"iconUrl"
,
hotSearch
.
getIconUrl
());
document
.
put
(
"downtext"
,
hotSearch
.
getDowntext
());
}
if
(
"百度热搜"
.
equals
(
hotSearch
.
getType
())){
document
.
put
(
"topic_lead"
,
hotSearch
.
getTopicLead
());
}
...
...
@@ -80,6 +85,9 @@ public class HotSearchCacheDAO {
if
(
"百度热搜"
.
equals
(
hotSearch
.
getType
())){
document
.
remove
(
"topic_lead"
);
}
if
(
"微博要闻榜"
.
equals
(
hotSearch
.
getType
())){
document
.
remove
(
"downtext"
);
}
dataes
.
add
(
document
);
});
return
dataes
;
...
...
@@ -210,7 +218,10 @@ public class HotSearchCacheDAO {
if
(
"虎嗅热文推荐"
.
equals
(
type
)){
nowDoc
.
put
(
"comment_count"
,
document
.
getLong
(
"comment_count"
));
}
if
(
"微博要闻榜"
.
equals
(
type
)){
nowDoc
.
put
(
"downtext"
,
document
.
getString
(
"downtext"
));
nowDoc
.
put
(
"comment_count"
,
document
.
getLong
(
"comment_count"
));
}
if
(
topicResult
!=
null
){
nowDoc
.
put
(
"topicResult"
,
topicResult
);
}
...
...
src/main/java/com/zhiwei/searchhotcrawler/timer/quartz/GatherTimer.java
View file @
3e5c72ea
...
...
@@ -588,4 +588,17 @@ public class GatherTimer {
TipsUtils
.
addHotList
(
HotSearchType
.
微博娱乐榜
.
name
(),
weiBoEntertainmentList
);
logger
.
info
(
"微博娱乐榜采集结束..."
);
}
/**
*微博娱乐榜采集
*/
@Async
(
value
=
"myScheduler"
)
@Scheduled
(
cron
=
"0 * * * * ? "
)
public
void
crawlerWeiBoNews
(){
logger
.
info
(
"微博要闻榜开始采集..."
);
Date
date
=
DateUtils
.
getMillSecondTime
(
new
Date
());
List
<
HotSearchList
>
WeiboNewsList
=
WeiboNewsCrawler
.
weiboNewsByPhone
(
date
);
logger
.
info
(
"{}, 微博要闻榜此轮采集到的数据量为:{}"
,
new
Date
(),
WeiboNewsList
!=
null
?
WeiboNewsList
.
size
()
:
0
);
TipsUtils
.
addHotList
(
HotSearchType
.
微博要闻榜
.
name
(),
WeiboNewsList
);
logger
.
info
(
"微博要闻榜采集结束..."
);
}
}
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