一个查看各大BTC比特币交易站实时价格的命令行工具

SegmentFault用户,独立开发者,前支付宝前端开发工程师郭宇,为极客们准备的一个命令行工具,方便大家看btc各交易站实时价格:

《一个查看各大BTC比特币交易站实时价格的命令行工具》

安装

$ [sudo] npm install btc -g  

命令行界面

只要运行btc,实时价格会自动显示

$ btc 

快捷键

btc cli为您提供一些实用的快捷键:

[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  

实例

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);
});  

添加你比特币的API

可以随时增加你新的比特币api:

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

确保每个API都有其独特的URL网站,并填写参数货币

API

请查看该文件:index.js

btc支持以下交易平台及方式:

原文是 郭宇 发布在自己github 项目上的说明文档
本文由 segmentfault 翻译

    原文作者:工具
    原文地址: https://segmentfault.com/a/1190000000343448
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞