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
51a4bfa2
Commit
51a4bfa2
authored
Sep 03, 2021
by
chenweitao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/working' into working
parents
d9567459
71498213
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboEntertainmentCrawler.java
+5
-3
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+3
-0
src/main/java/com/zhiwei/searchhotcrawler/test/WeiboEntertainmentCrawlerTest.java
+5
-3
src/main/java/com/zhiwei/searchhotcrawler/timer/quartz/GatherTimer.java
+0
-1
No files found.
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboEntertainmentCrawler.java
View file @
51a4bfa2
...
...
@@ -57,14 +57,16 @@ public class WeiboEntertainmentCrawler {
JSONObject
cardInfo
=
cardGroup
.
getJSONObject
(
j
);
String
name
=
cardInfo
.
getString
(
"desc"
);
long
hotCount
=
cardInfo
.
getLongValue
(
"desc_extr"
);
String
icon
=
cardInfo
.
getString
(
"icon"
);
if
(
StringUtils
.
isNotBlank
(
icon
))
{
icon
=
icon
.
split
(
"_"
)[
1
].
split
(
".png"
)[
0
];
String
iconUrl
=
cardInfo
.
getString
(
"icon"
);
String
icon
=
null
;
if
(
StringUtils
.
isNotBlank
(
iconUrl
))
{
icon
=
iconUrl
.
split
(
"_"
)[
1
].
split
(
".png"
)[
0
];
}
String
id
=
cardInfo
.
getString
(
"scheme"
);
String
ul
=
"https://m.weibo.cn/search?"
+
id
.
split
(
"[?]"
)[
1
];
rank
++;
HotSearchList
hotSearch
=
new
HotSearchList
(
ul
,
name
,
hotCount
,
hot
,
rank
,
HotSearchType
.
微博娱乐榜
.
name
(),
icon
,
date
);
if
(
Objects
.
nonNull
(
iconUrl
)){
hotSearch
.
setIconUrl
(
iconUrl
);}
if
(!
"娱乐动态数据详情"
.
equals
(
hotSearch
.
getName
())){
result
.
add
(
hotSearch
);
}
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
51a4bfa2
...
...
@@ -53,6 +53,9 @@ public class HotSearchCacheDAO {
if
(
"微博热搜"
.
equals
(
hotSearch
.
getType
())){
document
.
put
(
"iconUrl"
,
hotSearch
.
getIconUrl
());
}
if
(
"微博娱乐榜"
.
equals
(
hotSearch
.
getType
())){
document
.
put
(
"iconUrl"
,
hotSearch
.
getIconUrl
());
}
// if("今日头条热搜".equals(hotSearch.getType())){
// document.put("comment_count", hotSearch.getCommentCount());
// }
...
...
src/main/java/com/zhiwei/searchhotcrawler/test/WeiboEntertainmentCrawlerTest.java
View file @
51a4bfa2
...
...
@@ -57,14 +57,16 @@ public class WeiboEntertainmentCrawlerTest {
JSONObject
cardInfo
=
cardGroup
.
getJSONObject
(
j
);
String
name
=
cardInfo
.
getString
(
"desc"
);
long
hotCount
=
cardInfo
.
getLongValue
(
"desc_extr"
);
String
icon
=
cardInfo
.
getString
(
"icon"
);
if
(
StringUtils
.
isNotBlank
(
icon
))
{
icon
=
icon
.
split
(
"_"
)[
1
].
split
(
".png"
)[
0
];
String
iconUrl
=
cardInfo
.
getString
(
"icon"
);
String
icon
=
null
;
if
(
StringUtils
.
isNotBlank
(
iconUrl
))
{
icon
=
iconUrl
.
split
(
"_"
)[
1
].
split
(
".png"
)[
0
];
}
String
id
=
cardInfo
.
getString
(
"scheme"
);
String
ul
=
"https://m.weibo.cn/search?"
+
id
.
split
(
"[?]"
)[
1
];
rank
++;
HotSearchList
hotSearch
=
new
HotSearchList
(
ul
,
name
,
hotCount
,
hot
,
rank
,
HotSearchType
.
微博娱乐榜
.
name
(),
icon
,
date
);
if
(
Objects
.
nonNull
(
iconUrl
)){
hotSearch
.
setIconUrl
(
iconUrl
);}
if
(!
"娱乐动态数据详情"
.
equals
(
hotSearch
.
getName
())){
result
.
add
(
hotSearch
);
}
...
...
src/main/java/com/zhiwei/searchhotcrawler/timer/quartz/GatherTimer.java
View file @
51a4bfa2
...
...
@@ -10,7 +10,6 @@ import com.zhiwei.searchhotcrawler.dao.RedisDao;
import
com.zhiwei.searchhotcrawler.dao.WeiboSuperTopicDAO
;
import
com.zhiwei.searchhotcrawler.crawler.HotSearch36KrCrawler
;
import
com.zhiwei.searchhotcrawler.crawler.HuXiuHotSearchCrawler
;
import
com.zhiwei.searchhotcrawler.test.DouYinTongChengCrawlerTest
;
import
com.zhiwei.searchhotcrawler.timer.TouTiaoExecutor
;
import
com.zhiwei.searchhotcrawler.util.DateUtils
;
import
com.zhiwei.searchhotcrawler.util.TipsUtils
;
...
...
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