Beispiel #1
0
 def getCurrency(self, currency):
     url = self.url + currency
     iso = "USD" + currency
     ret = urllib2.urlopen(urllib2.Request(url))
     jObj = json.loads(ret.read())
     if jObj['success'] == True :
         print True
         price = jObj['quotes'][iso]
         DBRepository.getInstance().updateCurrency("USD", currency, price)
Beispiel #2
0
 def selectHistory(self, exchange, coin):
     return DBRepository.getInstance().selectRecentHistory(exchange, coin)
Beispiel #3
0
 def insertHistory(self, exchange, coin, price, qnty, transaction_date):
     return DBRepository.getInstance().insertHistory(
         exchange, coin, price, qnty, transaction_date)
Beispiel #4
0
 def updatePrice(self, exchange, coin, first_price, last_price):
     DBRepository.getInstance().updatePrice(exchange, coin, first_price, last_price)
Beispiel #5
0
 def updateOrderBook(self, exchange, coin, bid, ask):
     DBRepository.getInstance().updateOrderBook(exchange, coin, bid, ask)