genebean / PiWeatherRock

Displays local weather on a Raspberry Pi
https://piweatherrock.technicalissues.us
MIT License
50 stars 23 forks source link

Add On bitcoin Current price? #15

Closed Alternating closed 4 years ago

Alternating commented 4 years ago

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'])
genebean commented 4 years ago

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.