Skip to content

Instantly share code, notes, and snippets.

@Dalboz
Last active February 25, 2024 18:51
Show Gist options
  • Save Dalboz/60187bdcde7bf93574613e96a60ad028 to your computer and use it in GitHub Desktop.
Save Dalboz/60187bdcde7bf93574613e96a60ad028 to your computer and use it in GitHub Desktop.
one liner para ver el precio del dólar paralelo :(
python -c "import requests; print({key: value for key, value in requests.post('https://dolartoday.com/wp-admin/admin-ajax.php', data={'action': 'dt_currency_calculator_handler', 'amount': '1'}).json().items()})"
# Modulos requeridos: LWP::Simple, LWP::UserAgent Mozilla::CA, JSON
perl -MLWP::Simple -MJSON -e '$ref = JSON->new->utf8(0)->decode(get("https://s3.amazonaws.com/dolartoday/data.json")); print $ref->{'USD'}{'transferencia'}. "\n";'
# dolar transferencia
curl -s 'https://s3.amazonaws.com/dolartoday/data.json' | python -c "import sys, json; print(json.load(sys.stdin)['USD']['transferencia'])"
@Dalboz
Copy link
Author

Dalboz commented Feb 17, 2024

Ya no existe el repositorio en amazon.

@siberiaaa
Copy link

Ya no existe el repositorio en amazon.

Conocerás otro repositorio de donde obtener el dato?

@Dalboz
Copy link
Author

Dalboz commented Feb 25, 2024

@siberiaaa puedes intentar haciendo un post como el que pongo:

curl -X POST -d "action=dt_currency_calculator_handler&amount=10" https://dolartoday.com/wp-admin/admin-ajax.php

Dejo un script en python que hace la misma función.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment