forked from vivek0/WhatBot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
price.py
28 lines (22 loc) · 836 Bytes
/
price.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
27
28
# -*- coding: utf-8 -*-
import untangle
import time
import requests
def getPrice():
while True:
global ui,iu,du,ud
value = untangle.parse("http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency=INR").double.cdata
ui = value
value = untangle.parse("http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&ToCurrency=USD").double.cdata
iu = value
data = requests.get("https://www.cryptonator.com/api/ticker/doge-usd").json()
price = data["ticker"]["price"]
du = price
data = requests.get("https://www.cryptonator.com/api/ticker/usd-doge").json()
price = data["ticker"]["price"]
ud = price
time.sleep(450)
ui = ""
iu = ""
du = ""
ud = ""