5 USAGE="Usage: $(basename "$0") [-h] [-t val]
6 Simple bash script to visualize the value of your bitcoin investment.
10 -t set the timespan (default: 30d)"
14 while getopts ':ht:' option; do
21 :) printf "missing argument for -%s\n" "$OPTARG" >&2
25 \?) printf "illegal option: -%s\n" "$OPTARG" >&2
33 if [ ! -f $CONFIG ]; then
40 echo "Created config: $CONFIG - Adapt config parameters!"
47 set datafile separator ","
49 set timefmt "%Y-%m-%d %H:%M:%S UTC"
50 set title "EXCHANGE: $EXCHANGE | TIMESPAN: $TIMESPAN\nZERO RATE: $ZERO_RATE $CURRENCY | ZERO VALUE: $ZERO_VALUE $CURRENCY"
51 plot "< wget -q -O - \"https://data.bitcoinity.org/export_data.csv?currency=$CURRENCY&data_type=price&exchange=$EXCHANGE&t=l×pan=$TIMESPAN\"" \
52 using 1:(\$3/$ZERO_RATE*$ZERO_VALUE) with lines title ""