Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
articlenewscrawler
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
chenweiyang
articlenewscrawler
Commits
e30d8b32
Commit
e30d8b32
authored
Jul 27, 2019
by
win 10
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除新浪财经头条历史文章数据的cookie
parent
95287efd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
src/main/java/com/zhiwei/parse/XinLangCaiJing.java
+7
-8
No files found.
src/main/java/com/zhiwei/parse/
WeiBo
CaiJing.java
→
src/main/java/com/zhiwei/parse/
XinLang
CaiJing.java
View file @
e30d8b32
...
@@ -18,19 +18,19 @@ import com.zhiwei.tools.timeparse.TimeParse;
...
@@ -18,19 +18,19 @@ import com.zhiwei.tools.timeparse.TimeParse;
import
okhttp3.Response
;
import
okhttp3.Response
;
public
class
WeiBo
CaiJing
{
public
class
XinLang
CaiJing
{
private
WeiBo
CaiJing
()
{
private
XinLang
CaiJing
()
{
throw
new
IllegalStateException
(
"
WeiBo
CaiJing class"
);
throw
new
IllegalStateException
(
"
XinLang
CaiJing class"
);
}
}
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WeiBo
CaiJing
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
XinLang
CaiJing
.
class
);
private
static
HttpBoot
httpBoot
=
new
HttpBoot
.
Builder
().
retryTimes
(
2
).
build
();
private
static
HttpBoot
httpBoot
=
new
HttpBoot
.
Builder
().
retryTimes
(
2
).
build
();
public
static
List
<
Map
<
String
,
Object
>>
get
WeiBoCaiJingHistory
(
String
uid
,
String
startTime
,
ProxyHolder
proxy
,
String
cookie
)
{
public
static
List
<
Map
<
String
,
Object
>>
get
XinLangCaiJingHistory
(
String
uid
,
String
startTime
,
ProxyHolder
proxy
)
{
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
int
page
=
1
;
//从第一页开始
int
page
=
1
;
boolean
nextPage
=
true
;
//是否有下一页
boolean
nextPage
=
true
;
//是否有下一页
while
(
nextPage
)
{
while
(
nextPage
)
{
String
jsonUrl
=
"https://cj.sina.com.cn/k/api/article/lists_by_author?uid="
+
uid
+
"&page="
+
page
+
"&count=20"
;
String
jsonUrl
=
"https://cj.sina.com.cn/k/api/article/lists_by_author?uid="
+
uid
+
"&page="
+
page
+
"&count=20"
;
...
@@ -78,9 +78,8 @@ public class WeiBoCaiJing {
...
@@ -78,9 +78,8 @@ public class WeiBoCaiJing {
}
else
{
}
else
{
nextPage
=
false
;
nextPage
=
false
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取
微博
财经头条数据失败 {}"
,
e
);
logger
.
error
(
"获取
新浪
财经头条数据失败 {}"
,
e
);
}
}
}
}
...
...
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