Commit 402290c1 by leiliangliang

更新微博热搜采集程序

parent 01532383
......@@ -423,7 +423,7 @@ public class WeiboHotSearchCrawler {
JSONObject readJson = json.getJSONArray("cardlist_head_cards").getJSONObject(0);
if (readJson.containsKey("head_data")) {
String midText = readJson.getJSONObject("head_data").getString("midtext");
String read = midText.replaceAll("阅读", "").replaceAll("讨论.*", "").trim();
String read = midText.replaceAll("今日阅读", "").replaceAll("今日讨论.*", "").trim();
String discussCount = midText.replaceAll(".*讨论", "").replaceAll("详情.*", "").trim();
String pictureUrl = readJson.getJSONObject("head_data").getString("portrait_url");
document.put("readCount", TipsUtils.getHotCount(read));
......@@ -644,7 +644,9 @@ public class WeiboHotSearchCrawler {
followerCount = Long.valueOf(followers_count);
} else {
String[] split = followers_count.split("万");
followerCount = Long.valueOf(split[0]) * 10000;
double foll = Double.parseDouble(split[0]);
followerCount =new Double(foll*10000).longValue();
// followerCount = Long.valueOf(split[0]) * 10000;
}
//用户头像地址
String profileImageUrl = users.getJSONObject(i1).getString("profile_image_url");
......
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