]> git.treefish.org Git - bitvalue.git/blobdiff - bitvalue
Hide gnuplot error output
[bitvalue.git] / bitvalue
index 9cb4ee96eaf94cb081d4e9964708d3e358e6efac..1454cab95547d91181757f3fec9c7c1d990e1e58 100755 (executable)
--- a/bitvalue
+++ b/bitvalue
@@ -5,12 +5,12 @@ HOST=data.bitcoinity.org
 
 TIMESPAN="24h"
 
-USAGE="Usage: $(basename "$0") [-h] [-t val]
+USAGE="Usage: $(basename "$0") [-h] [-t 10m|1h|24h|3d|7d|30d|6m|2y|5y|all]
 Simple bash script to visualize the value of your bitcoin investment.
 
 Arguments:
   -h  show this help text
-  -t  set the timespan (default: $TIMESPAN)"
+  -t  used timespan (default: $TIMESPAN)"
 
 while getopts ':ht:' option; do
     case "$option" in
@@ -35,8 +35,7 @@ if [ ! -f $CONFIG ]; then
     cat << EOF > $CONFIG
 EXCHANGE="bitstamp"
 CURRENCY="EUR"
-ZERO_RATE="1"
-ZERO_VALUE="1"
+BTC="1"
 EOF
     echo "Created config: $CONFIG - Adapt config parameters!"
 fi
@@ -53,9 +52,9 @@ set terminal dumb
 set datafile separator ","
 set xdata time
 set timefmt "%Y-%m-%d %H:%M:%S UTC"
-set title "EXCHANGE: $EXCHANGE | TIMESPAN: $TIMESPAN\nZERO RATE: $ZERO_RATE $CURRENCY | ZERO VALUE: $ZERO_VALUE $CURRENCY"
+set title "EXCHANGE: $EXCHANGE | TIMESPAN: $TIMESPAN\nCURRENCY: $CURRENCY | BTC: $BTC "
 plot "< wget -q -O - \"https://$HOST/export_data.csv?currency=$CURRENCY&data_type=price&exchange=$EXCHANGE&t=l&timespan=$TIMESPAN\"" \
-     using 1:(\$3/$ZERO_RATE*$ZERO_VALUE) with lines title ""
+     using 1:(\$3*$BTC) with lines title ""
 EOF
 
 if [ $? -ne 0 ]; then