Skip to content

SupportClass/lfg-streamtip

Repository files navigation

lfg-streamtip Build Status

This is a NodeCG bundle.

Listens for tips to a given account on StreamTip and emits API events for other bundles to use. Also displays stats on the dashboard and easily allows the user to reset said stats.

This bundle integrates with lfg-nucleus.

Installation

  • Install to nodecg/bundles/lfg-streamtip
  • Create nodecg/cfg/lfg-streamtip.json with the clientId and accessToken of the StreamTip account that you wish to listen to:
{
  "clientId": "xxxxx",
  "accessToken": "yyyyy"
}

Usage

As a dashboard panel

If you simply want to see top tips for the daily and monthly periods on your dashboard, you are done.

In other bundles' view pages and dashboard panels

If you would like to use this data in another bundle, add the following code to your view/panel:

nodecg.listenFor('tip', 'lfg-streamtip', callback);

... where 'callback' is the name of a function with the signature function callback(data)

In other bundles' extensions

If you want to use tip events in another bundle's extension, add lfg-streamtip as a bundleDependency in your bundle's nodecg.json

Then add the following code:

var streamTip = nodecg.extensions['lfg-streamtip'];
streamTip.on('tip', function(tip) {
     // Do your thing.
});

License

lfg-streamtip is provided under the MIT license, which is available to read in the [LICENSE][] file. [license]: LICENSE