spotify-quiz-questions
Generates questions for music quiz
Fetches tracks from playlist of your choosing. Makes additional requests to fetch 'artists top tracks' or 'related artists' to construct question. Module uses spotify-web-api-node to make requests to Spotify API.
Installation
$ npm install --save spotify-quiz-questions
Usage
const SpotifyQuizQuestions = default const config = // client id for Spotify API clientId: '' // client id for Spotify API clientSecret: '' // if refresh token should auto update. defaults to false. shouldUpdateRefreshToken: false const spotifyQuizQuestions = config const options = // playlist used to generate questions. defaults to 'Top 100 tracks currently on Spotify' playlist: name: 'Top 100 tracks currently on Spotify' id: '4hOKQuZbraPDIfaGbM3lKI' owner: 'spotify' // "guess the artist name" or "guess the track title" type of questions // 'track title', 'artist name' or 'mix'. defaults to 'mix' questionType: 'mix' // number of questions, max is 12. defaults to 10. amount: 10 spotifyQuizQuestions
Typescript
Yes! Module comes bundled with declaration files.
;; ; ; spotifyQuizQuestions.getQuestionsoptions .then .catchconsole.logerr;
License
MIT © Simon Johansson