npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

trovowrapped

v1.0.0

Published

Unofficial NodeJS API Wrapper for Trovo.live Streaming Platform.

Downloads

19

Readme

TrovoWrapped

npm package

TrovoWrapped is NodeJS API Wrapper for trovo.live Streaming Platform offering Notification when Channel goes Live, Information about Channels, Information about Categories and so on.

Features

Channels

  • Get Channel by Name/Username
  • Get Channel by ID
  • Get Channel ID from Name/Username
  • Get Multiple Channels from Name/Username
  • Get Username from ID
  • Get Profile Image
  • Get Subscribers Count
  • Get whether Channel is Live
  • Get Followers Count
  • Get notification when Channel go Live (Listen for event)

Categories

  • Get List of Categories
  • Search Categories

Installation

npm install trovowrapped

Easy Usage

const { TrovoClient } = require("trovowrapped");

// Initialize Client
const trovoClient = new TrovoClient("apiKey");

// Initialize Client with Channel Live Notifications which checks every 60 seconds
// const trovoClient = new TrovoClient("apiKey", { checkLive: true, checkInterval: 60, liveChannels: ["channelName"] });

// Get information about Channel
trovoClient.channels.getChannelByName("channelName").then((response) =>  {
  console.log(response);
});

Usage

For beginning, you need to initialize Trovo Client as so:

const { TrovoClient } = require("trovowrapped");

// Initialize Trovo Client with apiKey, you can pass options after `apiKey` to specify whether to
// listen for Live Notifications, Interval for Checking & List of Channels for which to check.
const trovoClient = new TrovoClient("apiKey", { checkLive: true, checkInterval: 60, liveChannels: ["channelName"] });

and after that you can use functions on trovoClient.

Channel

Most of the Channel functions requires you to pass username parameter, but some of them requires id which represents Channel ID. To obtain Channel ID you can use getChannelId function.


Get Channel Information from Name/Username

trovoClient.channels.getChannelByName(username).then((result) => {
  console.log(result);
});

Get Channel Information from Channel ID

trovoClient.channels.getChannelById(id).then((result) => {
  console.log(result);
});

Get Channel ID from Name/Username

trovoClient.channels.getChannelId(username).then((result) => {
  console.log(result);
});

Get Multiple Channels from list of Names/Usernames

trovoClient.channels.getChannels([usernames]).then((result) => {
  console.log(result);
});

Get Channel Username from Channel ID

trovoClient.channels.getUsername(id).then((result) => {
  console.log(result);
});

Get Channel Profile Image from Name/Username

trovoClient.channels.getProfileImage(username).then((result) => {
  console.log(result);
});

Check whether Channel is Live

trovoClient.channels.isLive(username).then((result) => {
  console.log(result);
});

Get Number of Followers from Name/Username

trovoClient.channels.getFollowerCount(username).then((result) => {
  console.log(result);
});

Get Number of Subscribers from Name/Username

trovoClient.channels.getSubscriberCount(username).then((result) => {
  console.log(result);
});

Categories

Get list of Trovo Game Categories

trovoClient.categories.getAllCategories().then((result) => {
  console.log(result);
});

Search Trovo Game Categories by Query

trovoClient.categories.searchCategories(query, limit?).then((result) => {
  console.log(result);
});

Events

These are all events you can listen for, currently there is just one and it is 'trovoLive'.


Listen for Channel Live

trovoClient.events.subscribe("trovoLive" (channel) => {
  console.log(`Channel ${channel.name} is now Live!`);
})

Get Trovo API Client ID

  1. Go to https://developer.trovo.live/
  2. Login with your Trovo
  3. Click 'New Application' & fill in all required fields, for Redirect URLs put https://trovo.live
  4. Agree on Trovo Api Access Terms & Trovo Data Sharing Agreement
  5. Click 'Create' & wait for Trovo to approve your Application, this may take even a week
  6. When it get's accepted visit https://developer.trovo.live/, click 'Applications' and copy Client ID

Credits

  • Trovo.live API: https://developer.trovo.live/

Upcoming

  • ...