Commit f4fc46aa by leiliangliang

更新腾讯新闻链接

parent 806b0032
...@@ -50,18 +50,19 @@ public class TengXunCrawler { ...@@ -50,18 +50,19 @@ public class TengXunCrawler {
Integer rank = i; Integer rank = i;
String name = dataJson.getJSONObject(i).getString("title"); String name = dataJson.getJSONObject(i).getString("title");
String urlID = dataJson.getJSONObject(i).getString("id"); String urlID = dataJson.getJSONObject(i).getString("id");
String ur = dataJson.getJSONObject(i).getString("url");
String tengxunUrl = null; String tengxunUrl = null;
//String tengxunUrl = "https://view.inews.qq.com/topic/" + dataJson.getJSONObject(i).getString("id"); //String tengxunUrl = "https://view.inews.qq.com/topic/" + dataJson.getJSONObject(i).getString("id");
Long count = null; Long count = null;
String icon = null; String icon = null;
if (dataJson.getJSONObject(i).containsKey("topic")) { if (dataJson.getJSONObject(i).containsKey("topic")) {
tengxunUrl = "https://view.inews.qq.com/topic/" + urlID; tengxunUrl = ur+ urlID;
count = dataJson.getJSONObject(i).getJSONObject("topic").getLongValue("ranking_score"); count = dataJson.getJSONObject(i).getJSONObject("topic").getLongValue("ranking_score");
if (dataJson.getJSONObject(i).getJSONObject("topic").containsKey("rec_icon")) { if (dataJson.getJSONObject(i).getJSONObject("topic").containsKey("rec_icon")) {
icon = dataJson.getJSONObject(i).getJSONObject("topic").getString("rec_icon"); icon = dataJson.getJSONObject(i).getJSONObject("topic").getString("rec_icon");
} }
} else if (dataJson.getJSONObject(i).containsKey("hotEvent")) { } else if (dataJson.getJSONObject(i).containsKey("hotEvent")) {
tengxunUrl = "https://view.inews.qq.com/hotEvent/" + urlID; tengxunUrl = ur + urlID;
count = dataJson.getJSONObject(i).getJSONObject("hotEvent").getLongValue("hotScore"); count = dataJson.getJSONObject(i).getJSONObject("hotEvent").getLongValue("hotScore");
if (dataJson.getJSONObject(i).getJSONObject("hotEvent").containsKey("rec_icon")) { if (dataJson.getJSONObject(i).getJSONObject("hotEvent").containsKey("rec_icon")) {
icon = dataJson.getJSONObject(i).getJSONObject("hotEvent").getString("rec_icon"); icon = dataJson.getJSONObject(i).getJSONObject("hotEvent").getString("rec_icon");
......
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