Giter Site home page Giter Site logo

btc's Introduction

logo btc npm

a command-line bitcoin price board for geeks

screenshot

Installation

$ [sudo] npm install btc -g

Command Line Interface

just run btc , prices board will show

$ btc 

Shortcuts

btc cli provides some useful shortcuts for you:

[enter]  ->  refresh prices as you wish
[g]      ->  go to current exchange market
[a]      ->  autorefresh the current exchange market every 10 seconds, 
             press [a] to cancel or [enter] to cancel all
[q]      ->  quit

Example

var btc = require('btc');

// fetch a prices list
btc.price(function(err, prices){
    console.log(prices);
});

// fetch a seleced exchanger
btc.price('btcchina', function(err, prices){
    console.log(prices);
});

Add your coin's API

please feel free to add new coin's api:

$ git clone https://github.com/turingou/btc.git && cd btc
$ vi ./libs/exchangers.js

make sure every api has its unique url site and fill param currency.

API

check this file: index.js

btc supports exchanges below:

Contributors

 project  : btc
 repo age : 7 weeks
 active   : 12 days
 commits  : 24
 files    : 11
 authors  :
    14  Guo Yu                  58.3%
     4  Connor Keenan           16.7%
     2  Aleksander Gregorka     8.3%
     2  Glenn Murray            8.3%
     1  Andrew Seidl            4.2%
     1  ekousp                  4.2%

Contributing

  • Fork this repo
  • Clone your repo
  • Install dependencies
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Open a pull request, and enjoy <3

MIT license

Copyright (c) 2013 turing <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


docor generated using docor @ 0.1.0. brought to you by turingou

btc's People

Contributors

andrewseidl avatar ckeenan avatar glenn-murray-bse avatar guo-yu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btc's Issues

TypeError: Cannot read property 'last' of undefined

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)

How do I install on os x?

There is no homebrew formula and I don't know how to install it. Can anyone point me in the right direction?

Request Failed

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.

It can't work, Could you tell me the reason?

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:未找到命令

Can not install on Raspberry pi

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

crashes on keypress

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') { ... })

Crash when an exchange returns wrong / no data

  › 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.

request failed

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.