Commit f1569223 by [zhangzhiwei]

修改今日头条账号采集中的阅读数

parent c3de2f29
......@@ -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
+ "]";
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
{
......
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment