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
f1569223
Commit
f1569223
authored
Nov 01, 2018
by
[zhangzhiwei]
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改今日头条账号采集中的阅读数
parent
c3de2f29
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
10 deletions
+22
-10
src/main/java/com/zhiwei/toutiao/bean/TouTiaoArticle.java
+10
-1
src/main/java/com/zhiwei/toutiao/parse/TouTiaoArticleParse.java
+6
-4
src/main/java/com/zhiwei/toutiao/parse/TouTiaoChannelParse.java
+1
-1
src/main/java/com/zhiwei/toutiao/parse/TouTiaoParse.java
+4
-3
src/main/java/com/zhiwei/toutiao/parse/TouTiaoSearchParse.java
+1
-1
No files found.
src/main/java/com/zhiwei/toutiao/bean/TouTiaoArticle.java
View file @
f1569223
...
...
@@ -32,6 +32,7 @@ public class TouTiaoArticle implements Serializable{
private
String
commentCount
;
private
String
playCount
;
private
String
readNum
;
private
String
shareNum
;
public
String
getCommentCount
()
{
return
commentCount
;
}
...
...
@@ -95,9 +96,15 @@ public class TouTiaoArticle implements Serializable{
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getShareNum
()
{
return
shareNum
;
}
public
void
setShareNum
(
String
shareNum
)
{
this
.
shareNum
=
shareNum
;
}
public
TouTiaoArticle
(
String
url
,
String
title
,
String
user_id
,
String
source
,
Date
time
,
String
content
,
String
commentCount
,
String
playCount
,
String
readNum
,
String
type
)
String
playCount
,
String
readNum
,
String
shareNum
,
String
type
)
{
this
.
url
=
url
;
this
.
title
=
title
;
...
...
@@ -108,6 +115,7 @@ public class TouTiaoArticle implements Serializable{
this
.
content
=
content
;
this
.
readNum
=
readNum
;
this
.
playCount
=
playCount
;
this
.
shareNum
=
shareNum
;
this
.
commentCount
=
commentCount
;
}
...
...
@@ -124,6 +132,7 @@ public class TouTiaoArticle implements Serializable{
+
", commentCount = "
+
commentCount
+
", playCount = "
+
playCount
+
", readNum = "
+
readNum
+
", shareNum = "
+
shareNum
+
"]"
;
}
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoArticleParse.java
View file @
f1569223
...
...
@@ -53,6 +53,7 @@ public class TouTiaoArticleParse {
String
as
=
Tools
.
getAS
().
split
(
"_"
)[
0
];
String
cp
=
Tools
.
getAS
().
split
(
"_"
)[
1
];
String
url
=
"https://www.toutiao.com/pgc/ma/?page_type=1&media_id="
+
media_id
+
"&count=20&as="
+
as
+
"&cp="
+
cp
;
System
.
out
.
println
();
if
(
max_behot_time
!=
null
){
url
=
url
+
"&max_behot_time="
+
max_behot_time
;
}
...
...
@@ -104,12 +105,13 @@ public class TouTiaoArticleParse {
String
content
=
data
.
getString
(
"abstract"
);
String
time
=
data
.
getLongValue
(
"behot_time"
)*
1000
+
""
;
Date
date
=
TimeParse
.
stringFormartDate
(
time
);
String
readNum
=
data
.
getString
(
"
go_detail
_count"
);
String
readNum
=
data
.
getString
(
"
total_read
_count"
);
String
commentNum
=
data
.
getString
(
"comments_count"
);
String
playNum
=
data
.
getString
(
"play_effective_count"
);
String
playNum
=
data
.
getString
(
"detail_play_effective_count"
);
String
shareNum
=
data
.
getString
(
"share_count"
);
String
source
=
data
.
getString
(
"source"
);
String
user_id
=
data
.
getLong
(
"creator_uid"
)+
""
;
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
href
,
title
,
user_id
,
source
,
date
,
content
,
commentNum
,
playNum
,
readNum
,
"今日头条"
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
href
,
title
,
user_id
,
source
,
date
,
content
,
commentNum
,
playNum
,
readNum
,
shareNum
,
"今日头条"
);
dataList
.
add
(
tt
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -218,7 +220,7 @@ public class TouTiaoArticleParse {
}
title
=
content
.
substring
(
0
,
count
);
}
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
href
,
title
,
user_id
,
source
,
date
,
content
,
commentNum
,
playNum
,
readNum
,
"微头条"
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
href
,
title
,
user_id
,
source
,
date
,
content
,
commentNum
,
playNum
,
readNum
,
"
0"
,
"
微头条"
);
dataList
.
add
(
tt
);
}
catch
(
Exception
e
)
{
continue
;
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoChannelParse.java
View file @
f1569223
...
...
@@ -98,7 +98,7 @@ public class TouTiaoChannelParse {
}
url
=
getUrl
(
url
);
date
=
TimeParse
.
stringFormartDate
(
time
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
url
,
title
,
null
,
source
,
date
,
content
,
comment_count
,
"-1"
,
"-1"
,
"今日头条"
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
url
,
title
,
null
,
source
,
date
,
content
,
comment_count
,
"-1"
,
"-1"
,
"-1"
,
"今日头条"
);
ttList
.
add
(
tt
);
}
catch
(
JSONException
e
)
{
continue
;
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoParse.java
View file @
f1569223
...
...
@@ -146,12 +146,13 @@ public class TouTiaoParse {
String
content
=
data
.
getString
(
"abstract"
);
String
time
=
data
.
getString
(
"datetime"
);
Date
date
=
TimeParse
.
stringFormartDate
(
time
);
String
readNum
=
data
.
getString
(
"
go_detail
_count"
);
String
readNum
=
data
.
getString
(
"
total_read
_count"
);
String
commentNum
=
data
.
getString
(
"comments_count"
);
String
playNum
=
data
.
getString
(
"play_effective_count"
);
String
playNum
=
data
.
getString
(
"detail_play_effective_count"
);
String
shareNum
=
data
.
getString
(
"share_count"
);
if
(
endData
.
before
(
date
))
{
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
href
,
title
,
null
,
source
,
date
,
content
,
commentNum
,
playNum
,
readNum
,
"今日头条"
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
href
,
title
,
null
,
source
,
date
,
content
,
commentNum
,
playNum
,
readNum
,
shareNum
,
"今日头条"
);
dataList
.
add
(
tt
);
}
else
{
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoSearchParse.java
View file @
f1569223
...
...
@@ -90,7 +90,7 @@ public class TouTiaoSearchParse {
String
user_id
=
jso
.
getString
(
"user_id"
);
Date
date
=
TimeParse
.
stringFormartDate
(
time
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
url
,
title
,
user_id
,
source
,
date
,
content
,
comment_count
,
"-1"
,
"-1"
,
"今日头条"
);
TouTiaoArticle
tt
=
new
TouTiaoArticle
(
url
,
title
,
user_id
,
source
,
date
,
content
,
comment_count
,
"-1"
,
"-1"
,
"
-1"
,
"
今日头条"
);
ttList
.
add
(
tt
);
}
catch
(
JSONException
e
)
{
logger
.
debug
(
"解析数据出现问题"
,
e
.
fillInStackTrace
());
...
...
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