From d5414b1b07afcf1ef27d92262b39d773f920b838 Mon Sep 17 00:00:00 2001 From: Kolby Cansler Date: Thu, 23 Apr 2015 12:13:48 -0500 Subject: [PATCH 1/2] Added since param to get_history function --- okcoin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/okcoin.py b/okcoin.py index 5ba9b87..214a90f 100644 --- a/okcoin.py +++ b/okcoin.py @@ -49,8 +49,9 @@ def get_depth(self, symbol): data = self.get_json(depth_url,params) return( DepthObject(data) ) - def get_history(self, symbol): + def get_history(self, symbol, since): params = {'symbol': symbol} + params = {'since': since} if symbol == 'btc_usd' or symbol == 'ltc_usd': params['ok'] = 1 history_url = 'https://www.okcoin.com/api/trades.do' From 75ec0e6913981f1cca8b89a5072b0f782aa03792 Mon Sep 17 00:00:00 2001 From: Kolby Cansler Date: Thu, 23 Apr 2015 14:09:18 -0500 Subject: [PATCH 2/2] Made since an optional parameter Earlier commit added the since parameter to the get_history() function, but it isn't always needed. It can now be left out. --- okcoin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/okcoin.py b/okcoin.py index 214a90f..52302fe 100644 --- a/okcoin.py +++ b/okcoin.py @@ -49,9 +49,10 @@ def get_depth(self, symbol): data = self.get_json(depth_url,params) return( DepthObject(data) ) - def get_history(self, symbol, since): + def get_history(self, symbol, since=None): params = {'symbol': symbol} - params = {'since': since} + if since is not None: + params = {'since': since} if symbol == 'btc_usd' or symbol == 'ltc_usd': params['ok'] = 1 history_url = 'https://www.okcoin.com/api/trades.do'