Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
twitchonlinetracker
Advanced tools
Readme
Install: npm install --save twitchonlinetracker
Get a Client ID. See Step 1 of the Twitch API Introduction on how to do this.
const { TwitchOnlineTracker } = require('twitchonlinetracker')
const tracker = new TwitchOnlineTracker({
client_id: "your twitch app client id", // used for api requests
track: ['channel1', 'channel2'], // all the channels you want to track
pollInterval: 30, // how often in between polls in seconds. default 30
debug: true, // whether to debug to console
start: true // whether to start immediately. if you don't use this, you must call .start() later
})
// Listen to live event, it returns StreamData
tracker.on('live', streamData => {
console.log(`${streamData.user_name} just went live!`)
})
// Make sure you listen for errors
tracker.on('error', error => console.error)
NOTE: If you don't pass start: true
in the options, you must call tracker.start()
to start polling.
Create a new TwitchOnlineTracker
instance. It takes a TwitchOnlineTrackerOptions interface:
client_id
string required Your Twitch app's client idtrack
string[] An array of the channels you wish to track on startuppollInterval
number The amount of time in seconds between pollsdebug
boolean If true, output debug information to consolestart
boolean If true, start polling immediatelyStarts polling the Twitch API for stream changes.
Stops polling the Twitch API for stream changes.
Adds more streams to track. usernamesToTrack
expects an array of strings.
Stops tracking streams. usernamesToTrack
expects an array of strings.
When a stream is found to be live, fires this event. The callback function provides a StreamData parameter.
Example:
tracker.on('live', function (streamData) {
console.log(`${streamData.user_name} has started streaming with the title ${streamData.title} at https://twitch.tv/${streamData.user_name} for ${streamData.viewer_count} viewers!`)
})
When a stream is found to have gone offline, fires this event. The callback function provides a string.
Example:
tracker.on('offline', function (channel) {
console.log(`${channel} has gone offline.`)
})
Fires this event on error. Make sure you capture this event.
Example:
tracker.on('error', function (error) {
throw Error(error)
})
FAQs
A library to help track streamers and fires an event if they go online.
The npm package twitchonlinetracker receives a total of 3 weekly downloads. As such, twitchonlinetracker popularity was classified as not popular.
We found that twitchonlinetracker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.