Bitcoin Forum
May 08, 2024, 05:28:37 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Byobu script that shows the Bitcoin exchange rate in the status bar  (Read 665 times)
kseistrup (OP)
Hero Member
*****
Offline Offline

Activity: 566
Merit: 500


Unselfish actions pay back better


View Profile WWW
April 28, 2013, 05:15:46 PM
 #1

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.

Klaus Alexander Seistrup
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!