-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkraken.py
26 lines (19 loc) · 806 Bytes
/
kraken.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import time
import datetime
import json
import requests
def kraken_ltc():
krakenTick1 = requests.post('https://api.kraken.com/0/public/Ticker',data=json.dumps({"pair":"XLTCZUSD"}),
headers={"content-type":"application/json"})
return krakenTick1.json()['result']['XLTCZUSD']['c'][0]
def kraken_eth():
krakenTick3 = requests.post('https://api.kraken.com/0/public/Ticker',data=json.dumps({"pair":"XETHZUSD"}),
headers={"content-type":"application/json"})
return krakenTick3.json()['result']['XETHZUSD']['c'][0]
while True:
krakenliveltc = float(kraken_ltc())
krakenliveeth = float(kraken_eth())
print ('##################--KRAKEN--###########################')
print ('ETH = U$',krakenliveeth)
print ('LTC = U$',krakenliveltc)
time.sleep(60)