Author

Topic: Byobu script that shows the Bitcoin exchange rate in the status bar (Read 698 times)

hero member
Activity: 566
Merit: 500
Unselfish actions pay back better
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.
Jump to: