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
1c04790d
Commit
1c04790d
authored
May 27, 2021
by
chenweitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评论量讨论量数据类型超限
parent
88b81e78
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
src/main/java/com/zhiwei/searchhotcrawler/crawler/BaiDuHotSearchCrawler.java
+1
-1
src/main/java/com/zhiwei/searchhotcrawler/crawler/DouyinHotSearchCrawler.java
+2
-2
src/main/java/com/zhiwei/searchhotcrawler/crawler/SougoHotSearchCrawler.java
+1
-1
src/main/java/com/zhiwei/searchhotcrawler/crawler/WangYiHotSearchCrawler.java
+2
-2
No files found.
src/main/java/com/zhiwei/searchhotcrawler/crawler/BaiDuHotSearchCrawler.java
View file @
1c04790d
...
...
@@ -96,7 +96,7 @@ public class BaiDuHotSearchCrawler {
else
if
(!
element
.
select
(
"td.last"
).
select
(
"span.icon-fair"
).
isEmpty
())
{
hot
=
element
.
select
(
"td.last"
).
select
(
"span.icon-fair"
).
text
();
}
int
count
=
0
;
long
count
=
0
;
// 判断hot是否为空
if
(
StringUtils
.
isNotBlank
(
hot
))
{
count
=
Integer
.
valueOf
(
hot
);
...
...
src/main/java/com/zhiwei/searchhotcrawler/crawler/DouyinHotSearchCrawler.java
View file @
1c04790d
...
...
@@ -69,8 +69,8 @@ public class DouyinHotSearchCrawler {
word
=
wl
.
getString
(
"word"
);
//获取热度值
hotValueStr
=
wl
.
getString
(
"hot_value"
);
Integer
hotValue
=
null
;
hotValue
=
Integer
.
valueOf
(
hotValueStr
);
Long
hotValue
=
null
;
hotValue
=
Long
.
valueOf
(
hotValueStr
);
// logger.info("热度为:::{}", hot_value);
HotSearchList
douyin
=
new
HotSearchList
(
null
,
word
,
hotValue
,
position
,
HotSearchType
.
抖音热搜
.
name
(),
date
);
list
.
add
(
douyin
);
...
...
src/main/java/com/zhiwei/searchhotcrawler/crawler/SougoHotSearchCrawler.java
View file @
1c04790d
...
...
@@ -120,7 +120,7 @@ public class SougoHotSearchCrawler {
JSONObject
object
=
jsonArray
.
getJSONObject
(
j
);
int
rank
=
j
+
1
;
String
name
=
object
.
getString
(
"name"
);
Integer
count
=
object
.
getInt
Value
(
"num"
);
Long
count
=
object
.
getLong
Value
(
"num"
);
String
sougouUrl
=
"https://m.sogou.com/web/searchList.jsp?s_from=pcsearch&keyword="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
);
String
icon
=
object
.
getIntValue
(
"tag"
)
==
1
?
"热"
:
null
;
HotSearchList
hotSearchList
=
new
HotSearchList
(
sougouUrl
,
name
,
count
,
false
,
rank
,
HotSearchType
.
搜狗微信客户端热搜
.
name
(),
icon
,
date
);
...
...
src/main/java/com/zhiwei/searchhotcrawler/crawler/WangYiHotSearchCrawler.java
View file @
1c04790d
...
...
@@ -51,7 +51,7 @@ public class WangYiHotSearchCrawler {
for
(
int
i
=
0
;
i
<
jsonObject
.
size
();
i
++)
{
int
rank
=
i
+
1
;
String
name
=
jsonObject
.
getJSONObject
(
i
).
getString
(
"title"
);
int
count
=
jsonObject
.
getJSONObject
(
i
).
getInt
Value
(
"hotValue"
);
long
count
=
jsonObject
.
getJSONObject
(
i
).
getLong
Value
(
"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
);
...
...
@@ -90,7 +90,7 @@ public class WangYiHotSearchCrawler {
for
(
int
i
=
0
;
i
<
jsonObject
.
size
();
i
++)
{
int
rank
=
i
+
1
;
String
name
=
jsonObject
.
getJSONObject
(
i
).
getString
(
"doc_title"
);
int
count
=
jsonObject
.
getJSONObject
(
i
).
getIntValue
(
"hotScore"
)*
10000
;
long
count
=
jsonObject
.
getJSONObject
(
i
).
getIntValue
(
"hotScore"
)*
10000
;
String
contentId
=
jsonObject
.
getJSONObject
(
i
).
getString
(
"docId"
);
String
wangyiUrl
=
"https://c.m.163.com/news/a/"
+
contentId
+
".html"
;
HotSearchList
hotSearchList
=
new
HotSearchList
(
wangyiUrl
,
name
,
count
,
rank
,
HotSearchType
.
网易跟帖热议
.
name
(),
date
);
...
...
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