guo-yu / btc Goto Github PK
View Code? Open in Web Editor NEWa command-line bitcoin price board for geeks
License: MIT License
a command-line bitcoin price board for geeks
License: MIT License
Everytime I run btc I get:
› mtgox request fail
bitstamp request fail
btce request fail
futures796 request fail
coinbase request fail
btcchina request fail
okcoin request fail
chbtc request fail
fxbtc request fail
btctrade request fail
btc100 request fail
Do I need to do some extra configuration?
› mtgox $ 752.00000 14:57
bitstamp $ 746.00 14:57
futures796 updating...
btcchina request fail 14:57
okcoin ¥ 4973.0 14:57
chbtc ¥ 4950.0 14:57
fxbtc ¥ 4979 14:57
btctrade ¥ 5015 14:57
btc100 ¥ 4940.000 14:57
TypeError: Cannot read property 'last' of undefined
at wash (/usr/local/lib/node_modules/btc/libs/cli.js:50:34)
at /usr/local/lib/node_modules/btc/libs/cli.js:79:28
at /usr/local/lib/node_modules/btc/libs/bitcoin.js:59:21
at /usr/local/lib/node_modules/btc/node_modules/sdk/action.js:12:13
at res (/usr/local/lib/node_modules/btc/node_modules/sdk/node_modules/beer/index.js:15:9)
at Request._callback (/usr/local/lib/node_modules/btc/node_modules/sdk/node_modules/beer/index.js:54:9)
at Request.self.callback (/usr/local/lib/node_modules/btc/node_modules/sdk/node_modules/beer/node_modules/request/request.js:129:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/usr/local/lib/node_modules/btc/node_modules/sdk/node_modules/beer/node_modules/request/request.js:873:14)
at Request.EventEmitter.emit (events.js:117:20)
I will take a shot at adding error handling when I find some time.
Price API:
https://bityep.com/api/1/ticker
Thanks!
crashes on keypress for certain non-alphanumeric keys, for example .,?
.
/usr/lib/node_modules/btc/libs/cli.js:125
if (key.name == 'return') {
^
TypeError: Cannot read property 'name' of undefined
at List.module.exports (/usr/lib/node_modules/btc/libs/cli.js:125:16)
at List.EventEmitter.emit (events.js:99:17)
at List.onkeypress (/usr/lib/node_modules/btc/node_modules/term-list/index.js:54:8)
at ReadStream.EventEmitter.emit (events.js:126:20)
at emitKey (/usr/lib/node_modules/btc/node_modules/term-list/node_modules/keypress/index.js:406:12)
at ReadStream.onData (/usr/lib/node_modules/btc/node_modules/term-list/node_modules/keypress/index.js:48:14)
at ReadStream.EventEmitter.emit (events.js:126:20)
at TTY.onread (net.js:397:14)
Edit:
based on the keypress examples it looks like it's expected to check that key
is truthy prior to checking any properties. (if (key && key.name == 'return') { ... }
)
Similar to what http://bitcoinwisdom.com/ is now doing on nav bar for BTCChina
i just downloaded and every time I run BTC I get request failed.
› mtgox request fail
bitstamp request fail
btce request fail
futures796 request fail
coinbase request fail
btcchina request fail
okcoin request fail
chbtc request fail
fxbtc request fail
btctrade request fail
btc100 request fail
I think your API server is down, I guess.
pi@raspberrypi ~ $ sudo npm install btc -g
npm http GET https://registry.npmjs.org/btc
npm ERR! Error: failed to fetch from registry: btc
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.g (events.js:156:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.parserOnIncomingClient as onIncoming
npm ERR! You may report this log at:
npm ERR! http://bugs.debian.org/npm
npm ERR! or use
npm ERR! reportbug --attach /home/pi/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.6.11+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "btc" "-g"
npm ERR! cwd /home/pi
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: btc
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm not ok
I am getting this error on my mac mini. node has been installed with homebrew.
mtgox loading... bitstamp $ 834.00 10:39 btce $ 747.00 10:39 futures796 loading... btcchina loading... okcoin loading... chbtc loading... fxbtc loading... btctrade loading... btc100 loading... TypeError: Cannot read property 'last' of undefined at List.wash [as _wash] (/usr/local/share/npm/lib/node_modules/btc/libs/cli.js:35:31) at /usr/local/share/npm/lib/node_modules/btc/libs/cli.js:74:33 at /usr/local/share/npm/lib/node_modules/btc/libs/bitcoin.js:34:21 at /usr/local/share/npm/lib/node_modules/btc/node_modules/sdk/action.js:12:13 at res (/usr/local/share/npm/lib/node_modules/btc/node_modules/sdk/node_modules/beer/index.js:15:9) at Request._callback (/usr/local/share/npm/lib/node_modules/btc/node_modules/sdk/node_modules/beer/index.js:54:9) at Request.self.callback (/usr/local/share/npm/lib/node_modules/btc/node_modules/sdk/node_modules/beer/node_modules/request/request.js:129:22) at Request.EventEmitter.emit (events.js:98:17) at Request. (/usr/local/share/npm/lib/node_modules/btc/node_modules/sdk/node_modules/beer/node_modules/request/request.js:873:14) at Request.EventEmitter.emit (events.js:117:20)
There is no homebrew formula and I don't know how to install it. Can anyone point me in the right direction?
I clone the code, then follow the README. but show this:
cookier@cookier-virtual-machine:~/btc_geek/btc$ npm install btc -g
npm WARN deprecated [email protected]: This package is no longer maintained
npm WARN deprecated [email protected]: Use uuid module instead
/home/cookier/node-v6.11.2-linux-x64/bin/btc -> /home/cookier/node-v6.11.2-linux-x64/lib/node_modules/btc/bin/cli
/home/cookier/node-v6.11.2-linux-x64/lib
└── [email protected]
cookier@cookier-virtual-machine:~/btc_geek/btc$ btc
未找到 'btc' 命令,您要输入的是否是:
命令 'bti' 来自于包 'bti' (universe)
命令 'atc' 来自于包 'bsdgames' (universe)
命令 'bcc' 来自于包 'bcc' (main)
命令 'bc' 来自于包 'bc' (main)
命令 'dtc' 来自于包 'device-tree-compiler' (main)
命令 'btt' 来自于包 'blktrace' (universe)
命令 'tc' 来自于包 'iproute2' (main)
命令 'bts' 来自于包 'devscripts' (main)
命令 'butc' 来自于包 'openafs-client' (universe)
命令 'rtc' 来自于包 'nvram-wakeup' (universe)
命令 'htc' 来自于包 'httptunnel' (universe)
btc:未找到命令
BTC/USD
Ticker - https://btc-e.com/api/2/btc_usd/ticker
Trades - https://btc-e.com/api/2/btc_usd/trades
Depth - https://btc-e.com/api/2/btc_usd/depth
Thanks!
On Auto Refresh, don't cover over last value with "updating..." during the call as this can end up hiding the value more than it is shown.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.