BTC fixes

This commit is contained in:
Frank Villaro-Dixon 2014-09-30 23:47:26 +02:00
parent 3ec42e950b
commit 42eb493ff9

View file

@ -8,7 +8,7 @@ function update_file {
#echo WILL_WGET #echo WILL_WGET
} }
if [ -e $file ]; then if [ -s $file ]; then
#update if older than 1h #update if older than 1h
age=`stat -c %Y $file`; age=`stat -c %Y $file`;
now=`date +%s`; now=`date +%s`;
@ -20,7 +20,7 @@ if [ -e $file ]; then
#Fucking ugly, but works #Fucking ugly, but works
content=`cat $file | python -mjson.tool | grep -A3 EUR | tail -n3 | cut -d':' -f2 | cut -d'"' -f2`; content=`cat $file | python -mjson.tool | grep -A3 EUR | tail -n3 | cut -d':' -f2 | cut -d'"' -f2`;
p24h=`echo "$content" | sed -n 1p` p24h=`echo "$content" | sed -n 1p | cut -d. -f1`
p7d=`echo "$content" | sed -n 3p` p7d=`echo "$content" | sed -n 3p`
p30d=`echo "$content" | sed -n 2p` p30d=`echo "$content" | sed -n 2p`