Commit cf30abcd by [zhangzhiwei]
parents 38731ea7 3a1b65e6
......@@ -39,6 +39,7 @@ public class TouTiaoArticleParse {
private TouTiaoArticleParse() {}
private static Logger logger = LogManager.getLogger(TouTiaoArticleParse.class);
private static HttpBoot httpBoot = new HttpBoot();
/***
* 获取头条数据
*
......@@ -106,6 +107,9 @@ public class TouTiaoArticleParse {
String time = data.getLongValue("behot_time")*1000+"";
Date date = TimeParse.stringFormartDate(time);
String readNum = data.getString("total_read_count");
if(readNum == null) {
readNum = data.getInteger("internal_visit_count")+"";
}
String commentNum = data.getString("comments_count");
String playNum = data.getString("detail_play_effective_count");
String shareNum = data.getString("share_count");
......@@ -113,6 +117,7 @@ public class TouTiaoArticleParse {
String user_id = data.getLong("creator_uid")+"";
TouTiaoArticle tt = new TouTiaoArticle(href, title, user_id, source, date, content, commentNum, playNum, readNum, shareNum,"今日头条");
dataList.add(tt);
System.out.println(tt.toString());
}
} catch (Exception e) {
logger.error("数据解析出现问题,{}", e.getMessage());
......
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