genebean / PiWeatherRock

Displays local weather on a Raspberry Pi

Home Page:https://piweatherrock.technicalissues.us

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add On bitcoin Current price?

Alternating opened this issue · comments

I was wondering if you would be interested in adding in the current Bitcoin Price to the main screen above where it says if we need an umbrella or not? or maybe on the screen with the sunset or sunrise.

Here is some code but i'm unsure where or exactly how to add this with out breaking the weather station.

:-)
(source https://realpython.com/python-bitcoin-ifttt/)

BITCOIN_API_URL = 'https://api.coinmarketcap.com/v1/ticker/bitcoin/'

def get_latest_bitcoin_price():
response = requests.get(BITCOIN_API_URL)
response_json = response.json()
# Convert the price to a floating point number
return float(response_json[0]['price_usd'])

This project is focused solely on displaying weather information so I am not inclined to put time into implementing this. That said, if you want to work up a code submission that makes displaying this extra information optional then I would be happy to review it and, most likely, merge it in.