Zevent-api
Api for zevent
Installation
Install the package using
npm i --s zevent-api
Usage
You can import the package by simply using
const zapi = require('zevent-api');
Then start cooking!
Get all streamers names
Here is a code that allows you to get the name of every streamer:
const zapi = require('zevent-api');
zapi.streamersNames().then(names => {
console.log("Names:",names);
});
Get streamers donation goals
Here is a code that allows you to get the donation goals of every streamers:
const zapi = require('zevent-api');
zapi.getGoals().then(goals => {
goals.forEach((goal) => {
console.log(goal.tw+"'s goals are:",goal.goals);
});
});
Get streamers online
Here is a code that allows you to get the streamers online (and their names):
const zapi = require('zevent-api');
zapi.getOnline().then(streamers => {
const s = new Array();
streamers.forEach((on) => {
s.push(on.display+" ("+on.game+")");
});
console.log("There are",online.length,"streamers online:\n",s.join("\n"));
});
Get donnation amount
Here is a code that allows you to get the current donation amount:
const zapi = require('zevent-api');
zapi.donnationAmount().then(amount => {
console.log("Zevent got",amount.formatted);
});
Get current total viewer count
Here is a code that allows you to get the current viewers count:
const zapi = require('zevent-api');
zapi.viewersCount().then(count => {
console.log("Zevent currently has",count.formatted,"viewers");
});
Get place image
Here is a code that allows you to get the place image:
const zapi = require('zevent-api');
zapi.getPlaceImage().then(image => {
console.log("Place image URL:",image);
});
Breaking changes: 1.1.0
- Introducing functions with promises.
- Introduce getPlaceImage() function.
- Create typescript definitions.