An evented API wrapper for Barry's Donation Tracker, a service that makes tracking donations easier for Twitch broadcasters.
npm install barry-donations
var BarryDonations = require('barry-donations');
// New donations will be received via a REST endpoint
// barry-donations takes care of making and listening to the endpoint, but you must supply the hostname
var bd = new BarryDonations({
username: 'user',
password: 'pass',
hostname: 'yourserver.com', // don't add "http://" prefix. https currently unsupported
port: 1234, // optional, will use a random port if not supplied
reconnect: true // optional, attempt to automatically reconnect when disconnected. defaults to true.
});
bd.on('connected', function () {
console.log('connected');
});
bd.on('connectfail', function (e) {
console.error(e);
});
bd.on('error', function (e) {
console.error(e);
});
bd.on('disconnected', function (e) {
console.error(e);
});
bd.on('reconnecting', function (timerDuration) {
console.log('reconnecting in %d seconds', timerDuration);
});
bd.on('initialized', function (data) {
console.log("[init]" + data);
});
bd.on('newdonations', function (data) {
console.log("[newdonations] " + data);
});
- Fork it ( http://github.com/langeh/barry-donations/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
barry-donations is provided under the MIT license, which is available to read in the [LICENSE][] file.
Barry Carlyon, developer of Barry's Donation Tracker