From f2cd30b291ddbf9f214fd98ee45b0d7661f5b2ac Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 7 Nov 2013 14:04:58 +0100 Subject: bitcoinwisdom ticker: dry up symbol --- gold/bitcoinwisdom/ticker.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gold') diff --git a/gold/bitcoinwisdom/ticker.js b/gold/bitcoinwisdom/ticker.js index e49f12c2..1aa212f2 100644 --- a/gold/bitcoinwisdom/ticker.js +++ b/gold/bitcoinwisdom/ticker.js @@ -33,8 +33,10 @@ var last_data = { function ticker_data_handler (data) { //console.log(data) - var ticker = data.btceltcbtc - var last_ticker = last_data.btceltcbtc + var symbol = 'btceltcbtc' + + var ticker = data[symbol] + var last_ticker = last_data[symbol] if (ticker.date !== last_ticker.date) { @@ -46,7 +48,7 @@ function ticker_data_handler (data) { var out = [ format_date(data.now) + '+' + pad(lag, -2, '0'), - 'btceltcbtc', + symbol, '\x1b[' + diff_color(diff) + 'm' + pad(ticker.last, 2 + 8, '0') + '\x1b[m', lag, freq, @@ -57,7 +59,7 @@ function ticker_data_handler (data) { beeper.beep(freq, 10); } - last_data.btceltcbtc = data.btceltcbtc; + last_data[symbol] = data[symbol]; } function diff_color (diff) { -- cgit v1.2.3