Bitcoin Forum

Other => Off-topic => Topic started by: kseistrup on April 28, 2013, 05:15:46 PM



Title: Byobu script that shows the Bitcoin exchange rate in the status bar
Post by: kseistrup on April 28, 2013, 05:15:46 PM
Prerequisites (other than byobu): wget and python

For Python3:
Code:
#!/bin/sh
wget -qO- https://blockchain.info/ticker \
| python3 -c '
import sys, json
print("฿ $%(last)s" % json.load(sys.stdin)["USD"])
'
# eof

For Python2:
Code:
#!/bin/sh
wget -qO- https://blockchain.info/ticker \
| python -c '
import sys, json
data = json.load(sys.stdin)["USD"]
print (u"\N{THAI CURRENCY SYMBOL BAHT} $%(last)s" % data).encode("utf-8")
'
# eof

Save the shell script as e.g. ~/.byoby/bin/333_bitcointicker and the bitcoin exchange rate will update in the status bar every 333 seconds.