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
34d3c078
Commit
34d3c078
authored
Oct 18, 2019
by
yangchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部分用户type不存在问题修复
parent
643adf87
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/main/java/com/zhiwei/toutiao/parse/TouTiaoAccountParse.java
+6
-4
No files found.
src/main/java/com/zhiwei/toutiao/parse/TouTiaoAccountParse.java
View file @
34d3c078
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Objects
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.util.Strings
;
...
...
@@ -69,8 +70,6 @@ public class TouTiaoAccountParse {
return
tta
;
}
public
static
TouTiaoAccount
getTouTiaoAccountInfoByUserId
(
String
userId
,
Proxy
proxy
){
String
url
=
"https://www.toutiao.com/c/user/"
+
userId
+
"/"
;
headerMap
=
Tools
.
getTouTiaoHeader
();
...
...
@@ -308,11 +307,14 @@ public class TouTiaoAccountParse {
*/
private
static
TouTiaoAccount
parseAccountByUserId
(
String
htmlBody
,
String
userId
,
Proxy
proxy
)
{
try
{
TouTiaoAccount
touTiaoAccount
=
new
TouTiaoAccount
();
;
TouTiaoAccount
touTiaoAccount
=
new
TouTiaoAccount
();
if
(
htmlBody
.
contains
(
"var header={"
)){
String
name
=
htmlBody
.
split
(
"var header"
)[
1
].
split
(
"name:'"
)[
1
].
split
(
"',"
)[
0
];
String
imgUrl
=
"https:"
+
htmlBody
.
split
(
"avtar_img:'"
)[
1
].
split
(
"',"
)[
0
];
Integer
type
=
Integer
.
valueOf
(
htmlBody
.
split
(
"type: '"
)[
1
].
split
(
"'"
)[
0
]);
Integer
type
=
null
;
if
(
NumberUtils
.
isDigits
(
htmlBody
.
split
(
"type: '"
)[
1
].
split
(
"'"
)[
0
]))
{
type
=
Integer
.
valueOf
(
htmlBody
.
split
(
"type: '"
)[
1
].
split
(
"'"
)[
0
]);
}
String
isDvStr
=
htmlBody
.
split
(
"dv:"
)[
1
].
split
(
","
)[
0
];
Boolean
isDv
=
false
;
if
(
"true"
.
equals
(
isDvStr
)){
...
...
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