def pull_poloniex_data():
try:
logger.info("pulling Poloniex data...")
req = get('https://poloniex.com/public?command=returnTicker')
data = req.json()
timestamp = time.time()
poloniex_data_point = ExchangeData.objects.create(
source=POLONIEX,
data=json.dumps(data),
timestamp=timestamp
)
logger.info("Saving Poloniex price, volume data...")
_save_prices_and_volumes(data, timestamp)
except RequestException:
return 'Error to collect data from Poloniex'
评论列表
文章目录