summaryrefslogtreecommitdiffstats
path: root/gold
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-11-07 14:04:58 +0100
committertv <tv@nomic.retiolum>2013-11-07 14:04:58 +0100
commitf2cd30b291ddbf9f214fd98ee45b0d7661f5b2ac (patch)
tree1661479a66b93031dea6f271e042b791dda97af9 /gold
parent9e2500389cda454c1ef99308c355e271b0f6b4b6 (diff)
bitcoinwisdom ticker: dry up symbol
Diffstat (limited to 'gold')
-rw-r--r--gold/bitcoinwisdom/ticker.js10
1 files changed, 6 insertions, 4 deletions
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) {