GithubHelp home page GithubHelp logo

meteor-spotify-web-api's People

Contributors

neoskai avatar xinranxiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

meteor-spotify-web-api's Issues

eliminate need to specify empty {} in spotifyApi.* calls

Need to eliminate the need to specify the empty hash {} in spotifyApi calls like so:
var response = spotifyApi.getUserPlaylists(userId, {});

It's not very intuitive to have to remember to specify nothing if you dont have any parameters. If you dont specify {}. the call never returns and the program hangs (no error).

It's also confusing that other methods like
var response = spotifyApi.getMe( );
Dont require any extra empty hashes {} because the method actually doesnt take any parameters (and also fails if you try to specify any, or none with {} ).

Marking this mainly as a TODO

401 (Unauthorized)

I am able to login with xinranxiao/meteor-accounts-spotify successfully. And with meteor-spotify-web-api I am able to call the NodeJS Spotify methods to access data.

However I am unable to point to direct hrefs or uri of playlist tracks without getting a 401 error.
GET https://api.spotify.com/v1/users/felideni/playlists/48J5k0lJh1M0pLZImt6c6l 401 (Unauthorized)

In my console I see the 401 error and also Sā€¦n.ConfigError {message: "Login service configuration not yet loaded"}

I am puzzled because I am able to login and access data, but to point at it and access it I get an error.

I am refreshing my token also ?

  // Get a user's playlists
  getUserPlaylists: function() {
    //Spotify call
    let spotifyApi = new SpotifyWebApi()
    //response object
    let userplaylists = spotifyApi.getUserPlaylists(Meteor.user().profile.id,function(err,data){
      if(err){
        console.log("Retrieval error ", err)
      }
      else{
        console.log("Success, your playlist ", data.body)
      }
    })
    //Need to refresh token
    if(checkTokenRefreshed(userplaylists, spotifyApi)){
      userplaylists = spotifyApi.getUserPlaylists(Meteor.user().profile.id,function(err,data){
        if(err){
          console.log("Retrieval error ", err)
        }
        else{
          console.log("Success, your playlist ", data.body)
        }
      })//end response
    }//end checkTokenRefreshed

    return userplaylists

  }//end getUserPlaylists

Here's my repo

Stuck Extracting on Meteor 1.4.1.1

When I try to add the package 'meteor add xinranxiao:spotify-web-api' the install never gets past 'Extracting xinranxiao:spotify-web-api...'.

I've tried solutions suggested elsewhere with making sure all other packages in the project are up-to-date and that my unzip tool is working properly (I'm able to install other packages). I'm on Windows 10, Meteor 1.4.1.1

getArtistTopTracks

here2is never logged into console and I never get any data

  searchArtistTopTracks: function(artistId) {
    console.log("here")
    var spotifyApi = new SpotifyWebApi();
    var response = spotifyApi.getArtistTopTracks(artistId);
    console.log("here2")

    // Need to refresh token
    if (checkTokenRefreshed(response, spotifyApi)) {
      response = spotifyApi.getArtistTopTracks(artistId);
    }

    return response.data.body;
  },

any suggestions?

Cannot perform Client Credential flow without using `meteor-accounts-spotify`

Hi,

I've been trying to connect to the Spotify Web API using the "Client Credential flow", e.g. using the application's clientID and clientSecret to authorize server side, without user account authorization.

When I call the SpotifyWebApi function provided by this wrapper (supplying a clientId and clientSecret) I do not have an access token yet to pass to the constructor, and the following error is thrown:

Error: No accessToken found. Please provide an accessToken or login with xinranxiao:accouns-spotify at setAccessTokens (packages/xinranxiao_spotify-web-api/packages/xinranxiao_spotify-web-api.js:126:1)

My question: How do I create a new SpotifyWebApi object in this wrapper without an access token?

What was exactly updated in credential process?

I've played after a few months with a small app for Spotify I made and suddenly I always get Insufficient client scope

This is the old function I'm using to refresh access token based on your example.

const checkTokenRefreshed = function(response, api) {
  if (response.error && response.error.statusCode === 401) {
    api.refreshAndUpdateAccessToken();
    return true;
  } else {
    return false;
  }
}

What should I update from the old approach, please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.