From d02ff4907ff37aed819e17a239453d6e59bbf1a6 Mon Sep 17 00:00:00 2001 From: rplees Date: Wed, 13 Dec 2023 11:28:49 +0800 Subject: [PATCH 1/2] no message --- .../api/investing/InvestingInvokerApis.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java index 5627b1c..4033f2c 100644 --- a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java +++ b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java @@ -117,7 +117,7 @@ public class InvestingInvokerApis { public JSONObject __page(int pageNum, int pageSize) throws IOException { String tmpl = "https://api.investing.com/api/financialdata/assets/equitiesByCountry/default?fields-list=id,name,symbol,high,low,last,lastPairDecimal,change,changePercent,volume,time,isOpen,url,flag,countryNameTranslated,exchangeId,performanceDay,performanceWeek,performanceMonth,performanceYtd,performanceYear,performance3Year,technicalHour,technicalDay,technicalWeek,technicalMonth,avgVolume,fundamentalMarketCap,fundamentalRevenue,fundamentalRatio,fundamentalBeta,pairType&country-id=14&page={}&page-size={}&include-major-indices=false&include-additional-indices=false&include-primary-sectors=false&include-other-indices=false&limit=0"; - String url = StrFormatter.format(tmpl, pageNum, pageSize); + String url = StrFormatter.format(tmpl, pageNum - 1, pageSize); Stopwatch stopwatch = Stopwatch.createStarted(); log.info("url: {}", url); Builder builder = builderGet(url); @@ -137,7 +137,7 @@ public class InvestingInvokerApis { */ public JSONObject __page_nifty100(int pageNum, int pageSize) throws IOException { String tmpl = "https://api.investing.com/api/financialdata/assets/equitiesByCountry/17943?fields-list=id,name,symbol,high,low,last,lastPairDecimal,change,changePercent,volume,time,isOpen,url,flag,countryNameTranslated,exchangeId,performanceDay,performanceWeek,performanceMonth,performanceYtd,performanceYear,performance3Year,technicalHour,technicalDay,technicalWeek,technicalMonth,avgVolume,fundamentalMarketCap,fundamentalRevenue,fundamentalRatio,fundamentalBeta,pairType&country-id=14&page={}&page-size={}&include-major-indices=false&include-additional-indices=false&include-primary-sectors=false&include-other-indices=false&limit=0"; - String url = StrFormatter.format(tmpl, pageNum, pageSize); + String url = StrFormatter.format(tmpl, 0, 0); Stopwatch stopwatch = Stopwatch.createStarted(); log.info("url: {}", url); Builder builder = builderGet(url); @@ -204,5 +204,11 @@ public class InvestingInvokerApis { public static void main(String[] args) throws IOException { JSONObject __market = of().__market(StockCode.of("17988")); System.out.println(__market); + + JSONObject __page = of().__page(1, 10); + JSONObject __page_nifty100 = of().__page_nifty100(1, 10); + + System.out.println(__page); + System.out.println(__page_nifty100); } } From 2c12e71574fe41e79d5271399f4fa9b72935902f Mon Sep 17 00:00:00 2001 From: rplees Date: Wed, 13 Dec 2023 11:49:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fixbug:=E7=83=AD=E9=97=A8=E8=82=A1=E7=A5=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infrastructure/api/investing/InvestingInvokerApis.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java index 4033f2c..bb6457a 100644 --- a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java +++ b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java @@ -136,8 +136,9 @@ public class InvestingInvokerApis { * @throws IOException */ public JSONObject __page_nifty100(int pageNum, int pageSize) throws IOException { - String tmpl = "https://api.investing.com/api/financialdata/assets/equitiesByCountry/17943?fields-list=id,name,symbol,high,low,last,lastPairDecimal,change,changePercent,volume,time,isOpen,url,flag,countryNameTranslated,exchangeId,performanceDay,performanceWeek,performanceMonth,performanceYtd,performanceYear,performance3Year,technicalHour,technicalDay,technicalWeek,technicalMonth,avgVolume,fundamentalMarketCap,fundamentalRevenue,fundamentalRatio,fundamentalBeta,pairType&country-id=14&page={}&page-size={}&include-major-indices=false&include-additional-indices=false&include-primary-sectors=false&include-other-indices=false&limit=0"; - String url = StrFormatter.format(tmpl, 0, 0); + String tmpl = "https://api.investing.com/api/financialdata/assets/equitiesByIndices/17943?fields-list=id%2Cname%2Csymbol%2Chigh%2Clow%2Clast%2ClastPairDecimal%2Cchange%2CchangePercent%2Cvolume%2Ctime%2CisOpen%2Curl%2Cflag%2CcountryNameTranslated%2CexchangeId%2CperformanceDay%2CperformanceWeek%2CperformanceMonth%2CperformanceYtd%2CperformanceYear%2Cperformance3Year%2CtechnicalHour%2CtechnicalDay%2CtechnicalWeek%2CtechnicalMonth%2CavgVolume%2CfundamentalMarketCap%2CfundamentalRevenue%2CfundamentalRatio%2CfundamentalBeta%2CpairType&country-id=14&page={}&page-size={}&include-major-indices=false&include-additional-indices=false&include-primary-sectors=false&include-other-indices=false&limit=0"; +// String tmpl = "https://api.investing.com/api/financialdata/assets/equitiesByCountry/17943?fields-list=id,name,symbol,high,low,last,lastPairDecimal,change,changePercent,volume,time,isOpen,url,flag,countryNameTranslated,exchangeId,performanceDay,performanceWeek,performanceMonth,performanceYtd,performanceYear,performance3Year,technicalHour,technicalDay,technicalWeek,technicalMonth,avgVolume,fundamentalMarketCap,fundamentalRevenue,fundamentalRatio,fundamentalBeta,pairType&country-id=14&page={}&page-size={}&include-major-indices=false&include-additional-indices=false&include-primary-sectors=false&include-other-indices=false&limit=0"; + String url = StrFormatter.format(tmpl, pageNum - 1, pageSize); Stopwatch stopwatch = Stopwatch.createStarted(); log.info("url: {}", url); Builder builder = builderGet(url);