Commit e30d8b32 by win 10

去除新浪财经头条历史文章数据的cookie

parent 95287efd
...@@ -18,19 +18,19 @@ import com.zhiwei.tools.timeparse.TimeParse; ...@@ -18,19 +18,19 @@ import com.zhiwei.tools.timeparse.TimeParse;
import okhttp3.Response; import okhttp3.Response;
public class WeiBoCaiJing { public class XinLangCaiJing {
private WeiBoCaiJing() { private XinLangCaiJing() {
throw new IllegalStateException("WeiBoCaiJing class"); throw new IllegalStateException("XinLangCaiJing class");
} }
private static Logger logger = LoggerFactory.getLogger(WeiBoCaiJing.class); private static Logger logger = LoggerFactory.getLogger(XinLangCaiJing.class);
private static HttpBoot httpBoot = new HttpBoot.Builder().retryTimes(2).build(); private static HttpBoot httpBoot = new HttpBoot.Builder().retryTimes(2).build();
public static List<Map<String, Object>> getWeiBoCaiJingHistory(String uid, String startTime, ProxyHolder proxy, String cookie) { public static List<Map<String, Object>> getXinLangCaiJingHistory(String uid, String startTime, ProxyHolder proxy) {
List<Map<String, Object>> dataList = new ArrayList<Map<String,Object>>(); List<Map<String, Object>> dataList = new ArrayList<Map<String,Object>>();
int page = 1;//从第一页开始 int page = 1;
boolean nextPage = true;//是否有下一页 boolean nextPage = true;//是否有下一页
while(nextPage) { while(nextPage) {
String jsonUrl = "https://cj.sina.com.cn/k/api/article/lists_by_author?uid=" + uid + "&page=" + page + "&count=20"; String jsonUrl = "https://cj.sina.com.cn/k/api/article/lists_by_author?uid=" + uid + "&page=" + page + "&count=20";
...@@ -78,9 +78,8 @@ public class WeiBoCaiJing { ...@@ -78,9 +78,8 @@ public class WeiBoCaiJing {
}else { }else {
nextPage = false; nextPage = false;
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("获取微博财经头条数据失败 {}", e); logger.error("获取新浪财经头条数据失败 {}", e);
} }
} }
......
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