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
84ce86e8
Commit
84ce86e8
authored
Jan 25, 2021
by
马黎滨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mlb-template-local' into 'mlbWork'
新浪热榜采集更新+微博封面图更新 See merge request
!67
parents
ccb11676
76e4f01b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
src/main/java/com/zhiwei/searchhotcrawler/crawler/XinLangHotSearchCrawler.java
+9
-1
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+3
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/crawler/XinLangHotSearchCrawler.java
View file @
84ce86e8
...
@@ -58,7 +58,13 @@ public class XinLangHotSearchCrawler {
...
@@ -58,7 +58,13 @@ public class XinLangHotSearchCrawler {
Integer
rank
=
i
+
1
;
Integer
rank
=
i
+
1
;
String
hotValue
=
jsonArray
.
getJSONObject
(
i
).
getString
(
"hotValue"
);
String
hotValue
=
jsonArray
.
getJSONObject
(
i
).
getString
(
"hotValue"
);
Integer
count
=
TipsUtils
.
getHotCount
(
hotValue
);
Integer
count
=
TipsUtils
.
getHotCount
(
hotValue
);
String
showTags
=
jsonArray
.
getJSONObject
(
i
).
getString
(
"showTags"
);
String
showTags
;
if
(
jsonArray
.
getJSONObject
(
i
).
containsKey
(
"card"
)){
JSONArray
cardArray
=
jsonArray
.
getJSONObject
(
i
).
getJSONArray
(
"card"
);
showTags
=
cardArray
.
getJSONObject
(
0
).
getString
(
"showTags"
);
}
else
{
showTags
=
jsonArray
.
getJSONObject
(
i
).
getString
(
"showTags"
);
}
String
routeUri
=
jsonArray
.
getJSONObject
(
i
).
getString
(
"routeUri"
);
String
routeUri
=
jsonArray
.
getJSONObject
(
i
).
getString
(
"routeUri"
);
String
xinLangUrl
=
null
;
String
xinLangUrl
=
null
;
if
(
routeUri
.
contains
(
"groupId"
))
{
if
(
routeUri
.
contains
(
"groupId"
))
{
...
@@ -68,6 +74,7 @@ public class XinLangHotSearchCrawler {
...
@@ -68,6 +74,7 @@ public class XinLangHotSearchCrawler {
xinLangUrl
=
"https://m.so.com/s?q="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
)+
"&src=dfttrc&srcg=sina_shoulang_act"
;
xinLangUrl
=
"https://m.so.com/s?q="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
)+
"&src=dfttrc&srcg=sina_shoulang_act"
;
}
}
String
icon
=
null
;
String
icon
=
null
;
if
(
Objects
.
nonNull
(
showTags
))
{
if
(
showTags
.
contains
(
"新"
))
{
if
(
showTags
.
contains
(
"新"
))
{
icon
=
"新"
;
icon
=
"新"
;
}
else
if
(
showTags
.
contains
(
"热"
))
{
}
else
if
(
showTags
.
contains
(
"热"
))
{
...
@@ -75,6 +82,7 @@ public class XinLangHotSearchCrawler {
...
@@ -75,6 +82,7 @@ public class XinLangHotSearchCrawler {
}
else
if
(
showTags
.
contains
(
"沸"
))
{
}
else
if
(
showTags
.
contains
(
"沸"
))
{
icon
=
"沸"
;
icon
=
"沸"
;
}
}
}
HotSearchList
hotSearchList
=
new
HotSearchList
(
xinLangUrl
,
name
,
count
,
true
,
rank
,
HotSearchType
.
新浪热榜
.
name
(),
icon
,
date
);
HotSearchList
hotSearchList
=
new
HotSearchList
(
xinLangUrl
,
name
,
count
,
true
,
rank
,
HotSearchType
.
新浪热榜
.
name
(),
icon
,
date
);
hotSearchLists
.
add
(
hotSearchList
);
hotSearchLists
.
add
(
hotSearchList
);
}
}
...
...
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
84ce86e8
...
@@ -329,6 +329,9 @@ public class HotSearchCacheDAO {
...
@@ -329,6 +329,9 @@ public class HotSearchCacheDAO {
nowDoc
.
put
(
"readCount"
,
document
.
getInteger
(
"readCount"
));
nowDoc
.
put
(
"readCount"
,
document
.
getInteger
(
"readCount"
));
nowDoc
.
put
(
"discussCount"
,
document
.
getInteger
(
"discussCount"
));
nowDoc
.
put
(
"discussCount"
,
document
.
getInteger
(
"discussCount"
));
}
}
if
(
document
.
containsKey
(
"pictureUrl"
)){
nowDoc
.
put
(
"pictureUrl"
,
document
.
getString
(
"pictureUrl"
));
}
collection
.
replaceOne
(
query
,
nowDoc
);
collection
.
replaceOne
(
query
,
nowDoc
);
}
}
}
}
...
...
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