Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toutiao
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
toutiao
Commits
b2cab5c7
Commit
b2cab5c7
authored
Apr 18, 2019
by
yangchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 头条用户采集接口
parent
ebbe24fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/main/java/com/zhiwei/toutiao/parse/TouTiaoAccountParse.java
+3
-3
No files found.
src/main/java/com/zhiwei/toutiao/parse/TouTiaoAccountParse.java
View file @
b2cab5c7
...
...
@@ -45,14 +45,14 @@ public class TouTiaoAccountParse {
* @return TouTiaoAccount 返回类型
*/
public
static
TouTiaoAccount
getTouTiaoAccountInfoByName
(
String
name
,
Proxy
proxy
){
String
url
=
"https://www.toutiao.com/api/search/content/?aid=24&
offset=0&format=json&keyword="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
)+
"&autoload=true&count=20&cur_tab=4&from=media&pd=user"
;
String
url
=
"https://www.toutiao.com/api/search/content/?aid=24&
app_name=web_search&offset=0&format=json&keyword="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
)+
"&autoload=true&count=20&en_qc=1&cur_tab=4&from=media&pd=user×tamp="
+
System
.
currentTimeMillis
()
;
headerMap
=
Tools
.
getTouTiaoHeader
();
TouTiaoAccount
tta
=
null
;
try
{
String
htmlBody
=
downloadHtml
(
url
,
proxy
,
headerMap
);
tta
=
parseHtmlByAccount
(
htmlBody
,
name
,
proxy
);
if
(
tta
==
null
){
url
=
"https://www.toutiao.com/api/search/content/?aid=24&
offset=0&format=json&keyword="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
)+
"&autoload=true&count=20&cur_tab=1&from=search_tab&pd=synthesis"
;
url
=
"https://www.toutiao.com/api/search/content/?aid=24&
app_name=web_search&offset=0&format=json&keyword="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
)+
"&autoload=true&count=20&en_qc=1&cur_tab=1&from=search_tab&pd=synthesis×tamp="
+
System
.
currentTimeMillis
()
;
headerMap
.
put
(
"Referer"
,
"https://www.toutiao.com/search/?keyword="
+
URLCodeUtil
.
getURLEncode
(
name
,
"utf-8"
));
htmlBody
=
downloadHtml
(
url
,
proxy
,
headerMap
);
if
(
htmlBody
!=
null
){
...
...
@@ -61,7 +61,7 @@ public class TouTiaoAccountParse {
}
}
catch
(
Exception
e
)
{
e
.
fillInStackTrace
();
logger
.
error
(
"获取今日头条帐号数据连接超时"
,
e
);
logger
.
error
(
"获取今日头条帐号数据连接超时
{}
"
,
e
);
return
null
;
}
return
tta
;
...
...
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