Funcion repetida

This commit is contained in:
Roberto Alsina 2023-08-07 12:21:54 -03:00
parent 338944d82c
commit abfe0cbf27
1 changed files with 0 additions and 18 deletions

View File

@ -155,21 +155,3 @@ def get_adrs(secret, nombre):
except:
pass
return last_results[f"ADR/{nombre}"]
@router.get("/{secret}/ON/{nombre}")
def get_on(secret, nombre):
if secret != SECRET:
raise Exception("BAD")
nombre = nombre.upper()
access, refresh = get_token(ttl_hash=get_ttl_hash())
url = (
BASE_URL
+ f"/api/v2/Cotizaciones/obligacionesnegociables/ar/Todos?cotizacionInstrumentoModel.instrumento=obligacionesNegociables&cotizacionInstrumentoModel.pais=argentina&api_key={access}"
)
data = get(url, ttl_hash=get_ttl_hash())
try:
last_results[f"ON/{nombre}"]=[a for a in data["titulos"] if a["simbolo"] == nombre][0]
except:
pass
return last_results[f"ON/{nombre}"]