|
|
@@ -22,6 +22,7 @@ import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.net.InetSocketAddress;
|
|
|
import java.net.Proxy;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
|
@@ -76,6 +77,8 @@ public class TestCoinExport {
|
|
|
|
|
|
int MAX_NUMBER = 100;
|
|
|
int sortNum = 1;
|
|
|
+ Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1081));
|
|
|
+ proxy = Proxy.NO_PROXY;
|
|
|
for (int i = 1; i <= 5; i++) {
|
|
|
String coingeckoCoinsMarketsUrl = InitRunner.dicCodeMap.get("coingecko_coins_markets_url").getCodeValue();
|
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
|
@@ -89,7 +92,7 @@ public class TestCoinExport {
|
|
|
paramMap.put("order", "market_cap_desc");
|
|
|
Connection.Response response = null;
|
|
|
|
|
|
- response = JsoupUtil.requestBody(coingeckoCoinsMarketsUrl, JsoupUtil.HTTP_GET, Proxy.NO_PROXY, headerMap, paramMap);
|
|
|
+ response = JsoupUtil.requestBody(coingeckoCoinsMarketsUrl, JsoupUtil.HTTP_GET, proxy, headerMap, paramMap);
|
|
|
JSONArray result = JSONArray.parseArray(response.body());
|
|
|
|
|
|
for (int j = 0; j < result.size(); j++) {
|
|
|
@@ -103,6 +106,7 @@ public class TestCoinExport {
|
|
|
// 名称
|
|
|
if (marketData.containsKey("name") && null != marketData.get("name")) {
|
|
|
row.createCell(column++).setCellValue(marketData.getString("name"));
|
|
|
+ System.out.println(sortNum + ":" + marketData.getString("name"));
|
|
|
} else {
|
|
|
row.createCell(column++).setCellValue("");
|
|
|
}
|