13 lines
522 B
Plaintext
13 lines
522 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
COLOR1="#AAAAAA"
|
||
|
COLOR2="#444444"
|
||
|
|
||
|
|
||
|
ut=$(curl -s 'https://api.binance.com/api/v3/ticker/24hr?symbol=USDTTRY' -H 'accept: application/json' | grep -o 'lastPrice":"[^"]*' | cut -d\" -f3 | sed 's/.\{6\}$//')
|
||
|
ur=$(curl -s 'https://api.binance.com/api/v3/ticker/24hr?symbol=USDTRUB' -H 'accept: application/json' | grep -o 'lastPrice":"[^"]*' | cut -d\" -f3 | sed 's/.\{6\}$//')
|
||
|
price=$(awk "BEGIN{print $ur/$ut}")
|
||
|
price=$(printf %.2f "$price")
|
||
|
|
||
|
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $price RUB ^d^"
|