summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-07 14:10:25 +0100
committerlassulus <lassulus@googlemail.com>2013-11-07 14:10:25 +0100
commitd1b14200af459696d45b661fa71b4f17e7793979 (patch)
tree3edb50c4cbfcd8ffb15d85a766f75405cffb8dc2
parent9cbb93099faebd80cc44d68c818fb9e4e985950e (diff)
parentf2cd30b291ddbf9f214fd98ee45b0d7661f5b2ac (diff)
Merge branch 'master' of github.com:krebscode/painload
-rw-r--r--gold/bitcoinwisdom/ticker.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/gold/bitcoinwisdom/ticker.js b/gold/bitcoinwisdom/ticker.js
index be60ddb8..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,8 +48,8 @@ function ticker_data_handler (data) {
var out = [
format_date(data.now) + '+' + pad(lag, -2, '0'),
- 'btceltcbtc',
- '\e[' + diff_color(diff) + 'm' + pad(ticker.last, 2 + 8, '0') + '\e[m',
+ 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) {