New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-helix-api

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-helix-api - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

42

index.js

@@ -68,16 +68,15 @@ const request = require("request");

return new Promise(async resolve => {
const response = await this.getFollowers(user_id, 100);
const count = response.total;
let list = response.data;
let { cursor } = response.pagination;
let interval = setInterval(async () => {
if(list.length < count) {
const _response = await this.getFollowers(user_id, 100, cursor);
cursor = _response.pagination.cursor;
return list = list.concat(_response.data);
} else {
clearInterval(interval);
return resolve(list);
}
}, 200);
const count = await this.getFollowersCount(user_id);
let list = [];
let cursor = "";
const get = async () => {
const _response = await this.getFollowers(user_id, 100, cursor);
cursor = _response.pagination.cursor;
list = list.concat(_response.data);
if(list.length < count) return get();
else return resolve(list);
};
get();
});

@@ -89,4 +88,4 @@

const url = `https://api.twitch.tv/helix/users/follows?to_id=${user_id}`;
const response = await syncRequest({ url, headers: this.headers });
return response.total;
const { total } = await syncRequest({ url, headers: this.headers });
return total;
}

@@ -105,4 +104,6 @@

json: {
"channel[status]": title,
"channel[game]": game
channel: {
status: title,
game
}
},

@@ -122,3 +123,3 @@ headers: Object.assign(this.headers, { "Authorization": `OAuth ${this.access_token}` })

});
if(response.error) return { status: "error" };
if(response.error) return { status: "error", error: response.error };
return Object.assign({ status: "success" }, response);

@@ -129,3 +130,3 @@ }

if(!this.access_token) return console.error({ error: "You must to provide access token to get stream markers" });
const response = await syncRequest({
return await syncRequest({
url: "https://api.twitch.tv/helix/streams/markers",

@@ -136,3 +137,2 @@ method: "GET",

});
return response;
}

@@ -139,0 +139,0 @@

{
"name": "simple-helix-api",
"version": "1.0.5",
"version": "1.0.6",
"description": "The Simple Helix API allows developers to easily develop applications for Twitch",

@@ -5,0 +5,0 @@ "main": "index.js",

const HelixAPI = require("../index");
const Helix = new HelixAPI({
// client_id: "zmin05a65f74rln2g94iv935w58nyq",
client_id: "zmin05a65f74rln2g94iv935w58nyq",
access_token: "heeq1scx0yrpkllowto7zw181j1kur",

@@ -12,3 +12,3 @@ disableWarns: true

const { id } = user;
const response = await Helix.getFollowers(id, 20);
const response = await Helix.updateStream(id, "test", "League of Legends");
console.log(response);

@@ -15,0 +15,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc