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
e3740064
Commit
e3740064
authored
Jul 02, 2021
by
chenweitao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'working' into 'master'
Working See merge request
!97
parents
64992203
241bc05a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchList.java
+5
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
+5
-2
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+7
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchList.java
View file @
e3740064
...
...
@@ -99,6 +99,11 @@ public class HotSearchList implements Serializable{
*/
private
String
pictureUrl
;
/**
* 图片排位
**/
private
String
rankPic
;
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/crawler/WeiboHotSearchCrawler.java
View file @
e3740064
...
...
@@ -162,9 +162,12 @@ public class WeiboHotSearchCrawler {
if
(
StringUtils
.
isNotBlank
(
icon
))
{
icon
=
icon
.
split
(
"_"
)[
1
].
split
(
".png"
)[
0
];
}
String
rankPic
=
cardInfo
.
getString
(
"pic"
);
// String id = "http://s.weibo.com/weibo/" + URLCodeUtil.getURLEncode(name, "utf-8") + "&Refer=top";
String
id
=
cardInfo
.
getString
(
"scheme"
);
HotSearchList
hotSearch
=
new
HotSearchList
(
id
,
name
,
hotCount
,
hot
,
rank
,
HotSearchType
.
微博热搜
.
name
(),
icon
,
date
);
String
urlScheme
=
cardInfo
.
getString
(
"scheme"
);
HotSearchList
hotSearch
=
new
HotSearchList
(
urlScheme
,
name
,
hotCount
,
hot
,
rank
,
HotSearchType
.
微博热搜
.
name
(),
icon
,
date
);
hotSearch
.
setRankPic
(
rankPic
);
result
.
add
(
hotSearch
);
rank
++;
redisDao
.
addDataToSet
(
RedisConfig
.
WEIBO_HOTSEARCHIDS
,
name
+
"_微博热搜"
);
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
e3740064
...
...
@@ -43,6 +43,7 @@ public class HotSearchCacheDAO {
document
.
put
(
"rank"
,
hotSearch
.
getRank
());
document
.
put
(
"type"
,
hotSearch
.
getType
());
document
.
put
(
"icon"
,
hotSearch
.
getIcon
());
document
.
put
(
"rankPic"
,
hotSearch
.
getRankPic
());
if
(
"微博话题"
.
equals
(
hotSearch
.
getType
())){
document
.
put
(
"topic_lead"
,
hotSearch
.
getTopicLead
());
document
.
put
(
"comment_count"
,
hotSearch
.
getCommentCount
());
...
...
@@ -100,6 +101,12 @@ public class HotSearchCacheDAO {
boolean
recommend
=
false
;
// Integer readCount = document.getInteger("comment_count");
if
(
"微博热搜"
.
equals
(
type
)){
//排位标判断 例如 https://simg.s.weibo.com/20210408_search_point_orange.png
String
rankPic
=
document
.
getString
(
"rankPic"
);
if
(
nonNull
(
rankPic
)&&
rankPic
.
contains
(
"search_point"
)){
recommend
=
true
;
}
//后标判断
String
icon
=
document
.
getString
(
"icon"
);
if
(
"recom"
.
equals
(
icon
)
||
"jian"
.
equals
(
icon
)){
recommend
=
true
;
...
...
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