Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 1.55 KB

README.md

File metadata and controls

73 lines (52 loc) · 1.55 KB

nwitch-bitcoin-price

Build Status Dependency Status

nwitch (and slate-irc) plugin for getting Bitstamp's last sell price.

15:44 <KenanY> !bitcoin
15:44 <nwitch> Last Bitcoin price: $636.36

Example

As a nwitch plugin (using config.toml):

[plugins]
nwitch-bitcoin-price = true

Or through nwitch's API:

var Nwitch = require('nwitch');
var nwitchBitcoinPrice = require('nwitch-bitcoin-price');

var nwitch = new Nwitch({
  irc: {
    address: 'irc.freenode.org',
    port: 6667
  }
});

nwitch.use(nwitchBitcoinPrice());

Technically, all nwitch plugins are just slate-irc plugins, so you could also use this as a slate-irc plugin:

var net = require('net');
var irc = require('slate-irc');
var nwitchBitcoinPrice = require('nwitch-bitcoin-price');

var stream = net.connect({
  port: 6667,
  host: 'irc.freenode.org'
});

var client = irc(stream);
client.use(nwitchBitcoinPrice());

Installation

$ npm install nwitch-bitcoin-price

API

var nwitchBitcoinPrice = require('nwitch-bitcoin-price');

nwitchBitcoinPrice()

Returns a function that accepts an instance of slate-irc.