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
f51d3ad0
Commit
f51d3ad0
authored
Dec 01, 2021
by
leiliangliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增网易热榜主持人字段
parent
ec44077d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/WangYiHotSearchCrawler.java
+2
-0
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+9
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/crawler/WangYiHotSearchCrawler.java
View file @
f51d3ad0
...
...
@@ -51,10 +51,12 @@ public class WangYiHotSearchCrawler {
for
(
int
i
=
0
;
i
<
jsonObject
.
size
();
i
++)
{
int
rank
=
i
+
1
;
String
name
=
jsonObject
.
getJSONObject
(
i
).
getString
(
"title"
);
String
source
=
jsonObject
.
getJSONObject
(
i
).
getString
(
"source"
);
long
count
=
jsonObject
.
getJSONObject
(
i
).
getLongValue
(
"hotValue"
);
String
contentId
=
jsonObject
.
getJSONObject
(
i
).
getString
(
"contentId"
);
String
wangyiUrl
=
"https://c.m.163.com/news/a/"
+
contentId
+
".html"
;
HotSearchList
hotSearchList
=
new
HotSearchList
(
wangyiUrl
,
name
,
count
,
rank
,
HotSearchType
.
网易热榜
.
name
(),
date
);
hotSearchList
.
setDowntext
(
source
);
hotSearchLists
.
add
(
hotSearchList
);
}
log
.
info
(
"{}, 此轮网易新闻热榜采集到的数据量为:{}"
,
new
Date
(),
Integer
.
valueOf
(
hotSearchLists
!=
null
?
hotSearchLists
.
size
()
:
0
));
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
f51d3ad0
...
...
@@ -81,6 +81,9 @@ public class HotSearchCacheDAO {
document
.
put
(
"iconUrl"
,
hotSearch
.
getIconUrl
());
document
.
put
(
"downtext"
,
hotSearch
.
getDowntext
());
}
if
(
"网易热榜"
.
equals
(
hotSearch
.
getType
()))
{
document
.
put
(
"downtext"
,
hotSearch
.
getDowntext
());
}
if
(
"百度热搜"
.
equals
(
hotSearch
.
getType
()))
{
document
.
put
(
"topic_lead"
,
hotSearch
.
getTopicLead
());
}
...
...
@@ -101,6 +104,9 @@ public class HotSearchCacheDAO {
if
(
"微博要闻榜"
.
equals
(
hotSearch
.
getType
()))
{
document
.
remove
(
"downtext"
);
}
if
(
"网易热榜"
.
equals
(
hotSearch
.
getType
()))
{
document
.
remove
(
"downtext"
);
}
dataes
.
add
(
document
);
}
return
dataes
;
...
...
@@ -254,6 +260,9 @@ public class HotSearchCacheDAO {
nowDoc
.
put
(
"downtext"
,
document
.
getString
(
"downtext"
));
nowDoc
.
put
(
"comment_count"
,
document
.
getLong
(
"comment_count"
));
}
if
(
"网易热榜"
.
equals
(
type
))
{
nowDoc
.
put
(
"downtext"
,
document
.
getString
(
"downtext"
));
}
if
(
topicResult
!=
null
)
{
nowDoc
.
put
(
"topicResult"
,
topicResult
);
}
...
...
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