1
0
mirror of https://github.com/Llewellynvdm/CoinRate.git synced 2024-05-30 22:40:48 +00:00

Few fixes to the percentage error handeling. Updated the readme with the latest parameters and fixed some typos

This commit is contained in:
Llewellyn van der Merwe 2018-01-02 00:26:08 +02:00
parent f86bbd0f41
commit 629c5eb526
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
3 changed files with 38 additions and 14 deletions

View File

@ -35,14 +35,16 @@ Read [notify.txt](https://github.com/vdm-io/CoinRate/blob/master/notify.txt) for
Read [factory.txt](https://github.com/vdm-io/CoinRate/blob/master/factory.txt) for more details. Read [factory.txt](https://github.com/vdm-io/CoinRate/blob/master/factory.txt) for more details.
**Set your Dynamic details (if you want to do bulk checks based on percentages):**
Read [dynamic.txt](https://github.com/vdm-io/CoinRate/blob/master/dynamic.txt) for more details.
## Usage GET ## Usage GET
The syntax is quite simple: The syntax is quite simple:
``` ```
$./getPrice.sh <PARAMETERS> $./getPrice.sh <PARAMETERS>
<%%>: Required param
``` ```
**Parameters:** **Parameters:**
@ -66,7 +68,8 @@ Basic options
1 = once per/hour 1 = once per/hour
2 = everyTime (default) 2 = everyTime (default)
3 = only once 3 = only once
-v Value (above or below) at which to send/send notice -p The percentage up or down at which to send/show notice
-v Value (above or below) at which to send/show notice
example: 17000 or 14000,15000 example: 17000 or 14000,15000
-A Value Above at which to send notice -A Value Above at which to send notice
example: 17000 or 19000,18000 example: 17000 or 19000,18000
@ -74,24 +77,26 @@ Basic options
example: 14000 or 14000,15000 example: 14000 or 14000,15000
-b Send Notice below target value once a day -b Send Notice below target value once a day
-a Send Notice above target value once a day (default) -a Send Notice above target value once a day (default)
-k hide the above and below from result string
Advance options (factory option) Advance options (factory option)
====================================================== ======================================================
-f Path to file with multiple currency pair options -f Path to file with multiple currency pair options (Fixed values)
(see example factory.txt file for details) (see example factory.txt file for details)
-P Path to file with multiple currency pair options (Percentages)
(see example dynamic.txt file for details)
Message options Message options
====================================================== ======================================================
-q Quiet - Turn off terninal output -q Quiet - Turn off terminal output
-t Send A Telegram Notice -t Send A Telegram Notice
-T Set notify Line number to use (first line is default)
-s Send A SMS Notice -s Send A SMS Notice
-M Set sms Line number to use (first line is default)
-S Set smsto Line number to use (first line is default)
-l Show A Linux Notice via zenity -l Show A Linux Notice via zenity
-h display this help menu -h display this help menu
======================================================
Vast Development Method (vdm.io)
======================================================
``` ```
**Examples (CEX API):** **Examples (CEX API):**
@ -140,12 +145,22 @@ or
* * * * * /home/bitnami/coin/getPrice.sh -c XRP -C USD -aA 2.50,2.60,3 -bB 2.50,2.40,2.30 -so 3 -q -I 2 * * * * * /home/bitnami/coin/getPrice.sh -c XRP -C USD -aA 2.50,2.60,3 -bB 2.50,2.40,2.30 -so 3 -q -I 2
``` ```
## BASH, JQ, curl and bc installation ## Installation Requirements
> BASH, JQ, curl, bc, sed, md5sum, awk
**Debian & Ubuntu Linux:** **Debian & Ubuntu Linux:**
_These are probably already installed on your system_
```bash
$sudo apt-get install bash
$sudo apt-get install bc
$sudo apt-get install sed
$sudo apt-get install md5sum
$sudo apt-get install awk
```
_These you may need to install_
```bash ```bash
$sudo apt-get install bash (Probably BASH is already installed on your system)
$sudo apt-get install bc (Probably bc is already installed on your system)
$sudo apt-get install curl $sudo apt-get install curl
$sudo apt-get install jq $sudo apt-get install jq
``` ```

View File

@ -37,6 +37,8 @@ function runFactory () {
local currencypair=($cpairs) local currencypair=($cpairs)
# if percentage # if percentage
if (( "$PercentSwitch" == 1 )); then if (( "$PercentSwitch" == 1 )); then
# always rest updater (since it per currency pair
COINupdate=0
# check number of values # check number of values
if [ ${#currencypair[@]} == 3 ]; then if [ ${#currencypair[@]} == 3 ]; then
# set globals # set globals
@ -83,7 +85,14 @@ function runFactory () {
fi fi
else else
if (( "$allowEcho" == 1 )); then if (( "$allowEcho" == 1 )); then
echo "The file supplied is empty, please add your options to the file (see example factory.txt file for details)" # set correct file name
if (( "$PercentSwitch" == 1 )); then
file_name="dynamic"
else
file_name="factory"
fi
# show error message
echo "The file supplied is empty, please add your options to the file (see example ${file_name}.txt file for details)"
show_help >&2 show_help >&2
exit 1 exit 1
fi fi

View File

@ -86,7 +86,7 @@ Getting Coin Value in Fiat Currency at set price
Message options Message options
====================================================== ======================================================
-q Quiet - Turn off terninal output -q Quiet - Turn off terminal output
-t Send A Telegram Notice -t Send A Telegram Notice
-T Set notify Line number to use (first line is default) -T Set notify Line number to use (first line is default)
-s Send A SMS Notice -s Send A SMS Notice