Created
July 21, 2017 19:00
-
-
Save khannasarthak/b940d8a58ee0aa9a9a36037ca16a9a13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import requests | |
import json | |
from urllib.request import urlopen | |
from gi.repository import Notify | |
import time | |
rbtc = requests.get(url='https://blockchain.info/ticker') | |
objbtc = rbtc.json() | |
mybtc = 0.00812164 | |
myeth = 0.13370304 | |
btc = float((objbtc['USD']['last'])) | |
reth = requests.get(url='https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD') | |
objeth = reth.json() | |
eth = (objeth['USD']) | |
mytotal = round(mybtc*btc + myeth*eth,2) | |
body = 'My CrytpoMoney - USD :$'+str(mytotal) | |
summary = 'BTC: $'+str(round(mybtc*btc,2))+' ETH: $'+str(round(myeth*eth,2)) | |
Notify.init('CryptoMoney') | |
notification = Notify.Notification.new(body,summary) | |
notification.show() | |
Notify.uninit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment