From 6716e5113f82fe68487444cceb01ede02706cc48 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 17 Jan 2018 12:48:42 +0200 Subject: [PATCH] added luno API option --- README.md | 1 + functions.sh | 3 +++ getPrice.sh | 4 ++++ main.sh | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 91ccc70..075ffdc 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ API options 2 = [shapeshift] shapeshift.io 3 = [bitfinex] bitfinex.com 4 = [gate] gate.io + 5 = [luno] luno.com -x Hide API name from message Basic options diff --git a/functions.sh b/functions.sh index 9203e42..bcff9cf 100644 --- a/functions.sh +++ b/functions.sh @@ -542,6 +542,9 @@ function getURL () { elif [ "${API_target}" == "gate" ]; then # gate echo "${API_gate}${Currency}_${Target}" + elif [ "${API_target}" == "luno" ]; then + # luno + echo "${API_luno}${Currency}${Target}" fi } diff --git a/getPrice.sh b/getPrice.sh index 4f4e886..208b373 100755 --- a/getPrice.sh +++ b/getPrice.sh @@ -55,6 +55,7 @@ Getting Coin Value in Fiat Currency at set price 2 = [shapeshift] shapeshift.io 3 = [bitfinex] bitfinex.com 4 = [gate] gate.io + 5 = [luno] luno.com -x Hide API name from message Basic options @@ -122,6 +123,9 @@ while getopts hc:C:o:v:B:A:baqtT:sS:M:lf:I:kp:P: opt; do elif (( "$OPTARG" == 4 )); then API_target="gate" API_urlname="gate.io" + elif (( "$OPTARG" == 5 )); then + API_target="luno" + API_urlname="luno.com" fi ;; x) diff --git a/main.sh b/main.sh index 0cd364b..900491c 100644 --- a/main.sh +++ b/main.sh @@ -93,6 +93,11 @@ API_gate="https://data.gate.io/api2/1/ticker/" API_json_gate="last" API_error_gate="message" API_error_value_gate="null" +#luno +API_luno="https://api.mybitx.com/api/1/ticker?pair=" +API_json_luno="last_trade" +API_error_luno="error" +API_error_value_luno="null" # file path to config FilePath=''