https://api.binance.com/api/v3/ticker?symbols=["BTCUSDT","BNBBTC",]&windowSize=1d&type=full
https://api.binance.com/api/v3/ticker?symbols=["BTCUSDT","BNBBTC"]&windowSize=1d&type=full
<pre>urlencode() { local string="$1" local length="${#string}" local result="" for (( i = 0; i < length; i++ )); do local c="${string:$i:1}" case $c in [-_.~a-zA-Z0-9]) result+="$c" ;; *) result+="%$(printf '%02X' "'$c")" ;; esac done echo "$result" } # ---------------- BINANCE ------------------------------------- # Market # Market Data ServerBinance="https://api.binance.com/api/v3" response="" _Bin_RollingWindowPriceChangeStat() { local apiUrl="$ServerBinance/ticker" # Verifica la presenza di symbol o symbols if [[ "$1" == *","* ]]; then IFS=',' read -ra symbols <<< "$1" local encodedSymbols=$(IFS=,; printf "\"%s\"," "${symbols[@]}") apiUrl+="?symbols=[$encodedSymbols]" shift elif [ -n "$1" ]; then apiUrl+="?symbol=[\"$1\"]" shift fi # Aggiungi i restanti parametri if [ -n "$1" ] && [ -n "$2" ]; then apiUrl+="&windowSize=$1&type=$2" fi # Visualizza l'URL costruito prima della chiamata di curl echo "URL: $apiUrl" response=$(curl -s -X GET "$apiUrl") }
",]
"]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)