bit_bay_trades
This commit is contained in:
parent
898bf7d1eb
commit
67702f0547
|
|
@ -9,8 +9,8 @@ require 'json'
|
|||
pause_interval = 3
|
||||
|
||||
start_index = '-1'
|
||||
currencies = {1 => "BTC", 4 => "LSK", 7 => "GAME"}
|
||||
currency_ids = [4,7]
|
||||
currencies = {1 => "BTC", 4 => "LSK", 5 => "LTC", 7 => "GAME"}
|
||||
currency_ids = [5,4,7]
|
||||
#currency = Currency.where(name: 'LSK').first
|
||||
while true
|
||||
for currency_id in currency_ids
|
||||
|
|
@ -18,6 +18,8 @@ for currency_id in currency_ids
|
|||
bbt_index = BitBayTrade.where('currency_id = ?', currency_id).order('cast(tid as unsigned) DESC').first
|
||||
unless bbt_index.blank?
|
||||
start_index = bbt_index.tid
|
||||
else
|
||||
start_index = -1
|
||||
end
|
||||
uri = "https://bitbay.net/API/Public/#{currencies[currency_id]}PLN/trades.json?since=#{start_index}"
|
||||
puts "start at #{start_index} index for #{currencies[currency_id]}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue