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
08d4afee
Commit
08d4afee
authored
Nov 25, 2019
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微博热搜添加区分推荐位icon字段
parent
5b2136e2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchList.java
+19
-1
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
+0
-1
src/main/java/com/zhiwei/searchhotcrawler/timer/WeiboHotSearchRun.java
+1
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/bean/HotSearchList.java
View file @
08d4afee
...
...
@@ -36,11 +36,13 @@ public class HotSearchList implements Serializable{
private
String
type
;
//分类
private
String
icon
;
//热搜类型
public
HotSearchList
(){}
public
HotSearchList
(
String
url
,
String
name
,
Integer
count
,
Boolean
hot
,
Integer
rank
,
String
type
){
public
HotSearchList
(
String
url
,
String
name
,
Integer
count
,
Boolean
hot
,
Integer
rank
,
String
type
,
String
icon
){
this
.
id
=
name
+
"_"
+
new
Date
().
getTime
();
this
.
url
=
url
;
this
.
name
=
name
;
...
...
@@ -50,6 +52,7 @@ public class HotSearchList implements Serializable{
this
.
time
=
new
Date
();
this
.
day
=
TimeParse
.
dateFormartString
(
new
Date
(),
"yyyy-MM-dd"
);
this
.
type
=
type
;
this
.
icon
=
icon
;
}
...
...
@@ -79,6 +82,7 @@ public class HotSearchList implements Serializable{
+
", day = "
+
day
+
", changeCount = "
+
changeCount
+
", type = "
+
type
+
", icon = "
+
icon
+
"]"
;
}
...
...
@@ -143,6 +147,18 @@ public class HotSearchList implements Serializable{
this
.
hot
=
hot
;
}
public
Boolean
getHot
()
{
return
hot
;
}
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
String
getDay
()
{
return
day
;
}
...
...
@@ -167,4 +183,6 @@ public class HotSearchList implements Serializable{
this
.
type
=
type
;
}
}
src/main/java/com/zhiwei/searchhotcrawler/crawler/WeiboHotSearchCrawler.java
View file @
08d4afee
...
...
@@ -109,7 +109,6 @@ public class WeiboHotSearchCrawler {
String
url
=
"https://m.weibo.cn/api/container/getIndex?containerid=106003type%3D25%26t%3D3%26disable_hot%3D1%26filter_type%3Drealtimehot&title=%E5%BE%AE%E5%8D%9A%E7%83%AD%E6%90%9C&extparam=pos%3D0_0%26mi_cid%3D100103%26cate%3D10103%26filter_type%3Drealtimehot%26c_type%3D30&luicode=10000011&lfid=231583"
;
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
headerMap
.
put
(
"User-Agent"
,
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
);
String
htmlBody
;
try
{
List
<
HotSearchList
>
result
=
new
ArrayList
<
HotSearchList
>();
...
...
src/main/java/com/zhiwei/searchhotcrawler/timer/WeiboHotSearchRun.java
View file @
08d4afee
...
...
@@ -55,6 +55,7 @@ public class WeiboHotSearchRun extends Thread{
doc
.
put
(
"changeCount"
,
changeCount
);
doc
.
put
(
"rank"
,
weiboHotSearch
.
getRank
());
doc
.
put
(
"type"
,
weiboHotSearch
.
getType
());
doc
.
put
(
"icon"
,
weiboHotSearch
.
getIcon
());
data
.
add
(
doc
);
}
weiboHotSearchDAO
.
addHotSearchList
(
data
);
...
...
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