How to use GetTopGames() from TwitchAPI??

Hi peps, first time posting (~^-^~) ... I’m just trying something simple with the twitch API (Get the most popular channels from Twitch) which the NPM module I'm using has a function listed in the doc. Anyone familiar with the TwitchAPI? super scrub here, just got inspired to monkey around after watching Shiffman's TwitterAPI tutorials.

var TwitchApi = require('twitch-api');
var twitch = new TwitchApi({
    clientId: 'v4enppwav768h5ll59ykrqf6wuy85o',
    clientSecret: 'secret',
    // redirectUri: 'http://localhost.',
    // scopes: [array of scopes you want access to]
  });

twitch.getTopGames(25, gotData);

function gotData(data){
    console.log(data);
}

This is what I have so far, and totally not sure if I'm doing it correctly... console returns NULL :-/ Thanks for anyone who has a few minutes to take a look at the module ^_^

Tagged:

Answers

  • Not familiar with the twitch API, but I just wanted to mention it is important to:

    1. do a basic test that your personal clientID and clientSecret values are in fact correct -- can you get a basic response from the API outside the Processing sketch, e.g. via url/REST?
    2. do NOT post your correct values to any forum!
Sign In or Register to comment.