Commit e5fa93cf by cwy

客户端采集修改为 外部控制翻页

parent b60d852a
......@@ -423,13 +423,11 @@ public class TouTiaoArticleParse {
* @param maxBehotTime
* @return
*/
public static List<Map<String,Object>> getClientMicroToutiaoCrawler(String userId, ProxyHolder proxy,
public static Map<String, Object> getClientMicroToutiaoCrawler(String userId, ProxyHolder proxy,
Long maxBehotTime) {
Map<String, Object> rMap = new HashMap<>();
List<Map<String,Object>> dataList = new ArrayList<>();
String ma = "";
while(true) {
String url = "https://profile.zjurl.cn/api/feed/profile/v1/?category=profile_all&visited_uid="+userId+"&stream_api_version=82&offset="+maxBehotTime+"&version_code=7.5.3&version_name=70503&user_id="+userId+"&request_source=1&active_tab=dongtai&device_id=65&app_name=news_article";
ma = String.valueOf(maxBehotTime);
try (Response response = httpBoot.syncCall(RequestUtils.wrapGet(url),proxy)){
String result = response.body().string();
JSONObject json = JSONObject.parseObject(result);
......@@ -472,7 +470,6 @@ public class TouTiaoArticleParse {
map.put("readNum", readNum);
map.put("commentNum", commentNum);
map.put("user_id", userId);
System.out.println(map.toString());
dataList.add(map);
}
}
......@@ -480,16 +477,12 @@ public class TouTiaoArticleParse {
e.printStackTrace();
}
}
System.out.println(" 采集到 条 == "+dataList.size() + " -- " +ma + " -- " + maxBehotTime);
if(ma.equals(String.valueOf(maxBehotTime))) {
break;
}
rMap.put("data", dataList);
rMap.put("maxBehotTime", maxBehotTime);
} catch (Exception e) {
logger.info("客户端微头条采集错误 {}",e);
}
}
return dataList;
return rMap;
}
/**
......
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