From 269adea4cb49956f9875d74386d1b70b6068bbcc Mon Sep 17 00:00:00 2001 From: Arturo Volpe Date: Wed, 8 Nov 2023 19:06:31 -0300 Subject: [PATCH 1/2] fix: GNB base url Signed-off-by: Arturo Volpe --- client/public/index.html | 2 +- client/src/App.vue | 2 +- src/main/java/py/com/volpe/cotizacion/gatherer/GNB.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/public/index.html b/client/public/index.html index 1ad51da..0930ad5 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -12,7 +12,7 @@ gtag('js', new Date()); - gtag('config', 'UA-84291651-2'); + gtag('config', 'UA-84291651-2', 'auto'); diff --git a/client/src/App.vue b/client/src/App.vue index 6ef79bd..9549220 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -33,7 +33,7 @@ - © Arturo Volpe 2022 + © Arturo Volpe 2023 diff --git a/src/main/java/py/com/volpe/cotizacion/gatherer/GNB.java b/src/main/java/py/com/volpe/cotizacion/gatherer/GNB.java index fb3982e..6a978e8 100644 --- a/src/main/java/py/com/volpe/cotizacion/gatherer/GNB.java +++ b/src/main/java/py/com/volpe/cotizacion/gatherer/GNB.java @@ -27,7 +27,7 @@ public class GNB implements Gatherer { private final HTTPHelper helper; - private static final String WS_URL = "https://www.bancognbcaminamosjuntos.com.py/Yaguarete/public/quotations"; + private static final String WS_URL = "https://www.bancognb.com.py/Yaguarete/public/quotations"; @Override public List doQuery(Place place, List branches) { From 422ef82d445d67f5f19fb9d22537a43a1dca35fc Mon Sep 17 00:00:00 2001 From: Arturo Volpe Date: Wed, 8 Nov 2023 19:06:45 -0300 Subject: [PATCH 2/2] fix: Mercosur new page layout Signed-off-by: Arturo Volpe --- .../volpe/cotizacion/gatherer/Mercosur.java | 4 +- .../cotizacion/gatherer/MercosurTest.java | 16 +- .../volpe/cotizacion/gatherer/mercosur.html | 377 +++++++++++------- 3 files changed, 247 insertions(+), 150 deletions(-) diff --git a/src/main/java/py/com/volpe/cotizacion/gatherer/Mercosur.java b/src/main/java/py/com/volpe/cotizacion/gatherer/Mercosur.java index e0eb55f..294646c 100644 --- a/src/main/java/py/com/volpe/cotizacion/gatherer/Mercosur.java +++ b/src/main/java/py/com/volpe/cotizacion/gatherer/Mercosur.java @@ -29,7 +29,7 @@ @RequiredArgsConstructor public class Mercosur implements Gatherer { - private static final String BASE_URL = "https://2019.mercosurcambios.com/Sucursale/%s"; + private static final String BASE_URL = "https://site.mercosurcambios.com/Sucursale/%s"; private final HTTPHelper helper; @@ -55,7 +55,7 @@ private List getExchangeOf(String id) { Document doc = Jsoup.parse(html, "", Parser.htmlParser()); List toRet = new ArrayList<>(); - for (Element e : doc.select("table.table tbody tr")) { + for (Element e : doc.select("table tbody tr")) { QueryResponseDetail ed = new QueryResponseDetail(); Elements columns = e.getElementsByTag("th"); diff --git a/src/test/java/py/com/volpe/cotizacion/gatherer/MercosurTest.java b/src/test/java/py/com/volpe/cotizacion/gatherer/MercosurTest.java index 194b388..5bf25d7 100644 --- a/src/test/java/py/com/volpe/cotizacion/gatherer/MercosurTest.java +++ b/src/test/java/py/com/volpe/cotizacion/gatherer/MercosurTest.java @@ -49,17 +49,17 @@ void doQueryTest() throws IOException { List exchanges = data.get(0).getDetails(); QueryResponseDetail usd = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "USD")).findFirst().orElseThrow(); - assertEquals(6770, usd.getPurchasePrice()); - assertEquals(6890, usd.getSalePrice()); + assertEquals(7380, usd.getPurchasePrice()); + assertEquals(7440, usd.getSalePrice()); QueryResponseDetail brl = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "BRL")).findFirst().orElseThrow(); - assertEquals(1220, brl.getPurchasePrice()); - assertEquals(1280, brl.getSalePrice()); + assertEquals(1475, brl.getPurchasePrice()); + assertEquals(1500, brl.getSalePrice()); QueryResponseDetail eur = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "EUR")).findFirst().orElseThrow(); - assertEquals(6870, eur.getPurchasePrice()); - assertEquals(7580, eur.getSalePrice()); + assertEquals(7550, eur.getPurchasePrice()); + assertEquals(8210, eur.getSalePrice()); QueryResponseDetail arg = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "ARS")).findFirst().orElseThrow(); - assertEquals(20, arg.getPurchasePrice()); - assertEquals(36, arg.getSalePrice()); + assertEquals(7, arg.getPurchasePrice()); + assertEquals(9, arg.getSalePrice()); } diff --git a/src/test/resources/py/com/volpe/cotizacion/gatherer/mercosur.html b/src/test/resources/py/com/volpe/cotizacion/gatherer/mercosur.html index 079ec63..a98816a 100644 --- a/src/test/resources/py/com/volpe/cotizacion/gatherer/mercosur.html +++ b/src/test/resources/py/com/volpe/cotizacion/gatherer/mercosur.html @@ -1,140 +1,237 @@ - - - -
-
-
-

-

Cotizacíon de esta unidad


-
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MonedasCompraVenda
Dólar x Guarani - 6770 - - 6890 -
Real x Guarani - 1220 - - 1280 -
Dólar x Real - 5.380 - - 5.550 -
Euro x Guarani - 6870 - - 7580 -
Peso x Guarani - 20 - - 36 -
Peso x Real - 0.015 - - 0.031 -
Euro x Dólar - 1.000 - - 1.140 -
Dólar x Peso - 180 - - 280 -
Euro x Real - 5.480 - - 6.250 -
- Actualizado en: 18/07/2022 - 15:35
Actualizado 18/07/2022 - 15:35
-
- - -
- -
-
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Monedas + + Compra + + Venta +
+ + Dolar X + Guarani + + + 7380 + + + 7440 +
+ + Real X + Guarani + + + 1475 + + + 1500 +
+ + Dolar X + Real + + + 4.950 + + + 5.010 +
+ + Euro X + Guarani + + + 7550 + + + 8210 +
+ + Peso X + Guarani + + + 7 + + + 9 +
+ + Peso X + Real + + + 0.005 + + + 0.006 +
+ + Euro X + Dolar + + + 1.020 + + + 1.100 +
+ + Dolar X + Peso + + + 850 + + + 1050 +
+ + Euro X + Real + + + 5.030 + + + 5.570 +
Actualizado por MERCOSUR CAMBIO en + 08/11/2023 - 14:23