Hey guys, today I just wanted to share a neat piece of code that allows you to retrieve the price of Bitcoin, Steem and SBD on your Raspberry Pi. You could of course add any other cryptocurrency of your liking, but this code will display those 3 as they are my favorites.
I set up this Pi yesterday and gave it as a gift to my good friend and partner @albertogm, now he doesn't have to check coinmarketcap every 5 minutes!
If you want to create your own Crypto Price Board, all you have to do is get yourself a Sensehat for your Pi and copy this Python code:
from sense_hat import SenseHat
sense = SenseHat()
from urllib.request import urlopen
import json
import time
while True:
try:
url = urlopen('https://poloniex.com/public?command=returnTicker').read()
result = json.loads(url)
SBD = result['BTC_SBD']['last']
BTC = result['USDT_BTC']['last']
Steem = result['BTC_STEEM']['last']
SBD_USD = float(SBD) * float(BTC)
STEEMUSD = float(Steem) * float(BTC)
sense.show_message("BTC " + '{0:.0f}'.format(BTC), text_colour=[255, 215, 0])
sense.show_message("STEEM " + '{0:.2f}'.format(STEEMUSD), text_colour=[7, 24, 138])
sense.show_message("SBD " + '{0:.2f}'.format(SBD_USD), text_colour=[4, 112, 22])
time.sleep(3)
except:
sense.show_message("failed to retrieve feed")
time.sleep(3)
You should also add a cron job so that your script runs at starts, you can follow this guide that does just that: http://www.instructables.com/id/Raspberry-Pi-Launch-Python-script-on-startup/
Enjoy!
I did something similar recently. I need to fire it up again. I was trying to think of other things I could display.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It looks cool on the pi zero, it is also cheaper to deploy
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
That display was pretty cheap and there's a new version with more pixels. It's easy to program in Python. Here's my post about it.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I really need to learn even the simple coding as well , I’ll take a look . How’s the mining going ?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Python is the easiest language to learn in my opinion, is quite fun..
Still preparing the container, will post about it soon..
I hope things are well on your end!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I’ll look forward to it . My brothers still creating more trying to find a place to put them. Has them in different houses right now and sometimes it’s too much load and heat
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great stuff. I need somethink like that, since I also watch coinmarketcap a lot lately.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
That is what it means to be a passionate guy :)) I just wonder, is this really practical, since you will have to watch every letter one by one in a row, or is it more interesting because it just keep you focused?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
hehe you just have to wait a bit..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Interesting.
I am sure that there are many code examples to get information from websites - in this case, from poloniex.com. But, thanks for sharing.
I am interested in automation and possibly to facilitate or automate trading, but, this is a good tidbit. Thank you!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow great way of mining
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Awesome work thanks for sharing the code here this is very useful : )
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for sharing i will done upvote..A very good post @ chitty
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
excellent post...thanks for sharing a blog........
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
great one post..
carry on...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
how ingenious my friend
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for great post
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice post
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for sharing i will done upvote..A very good post
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thats so cool!!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i will always support you man..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have been interested in Pi but didn't know what to use it for, but this is brilliant!!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Que bueno! quiero el mismo en casa ;)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for sharing this information ,,, good luck my dear friend @chitty 👍👍😉
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit