xinranxiao / meteor-spotify-web-api Goto Github PK
View Code? Open in Web Editor NEWA meteor package for Spotify's web API.
License: MIT License
A meteor package for Spotify's web API.
License: MIT License
I tried to login from multiple iOS devices on your example app and also the one I implemented this accounts in and it just opens and closes the new window right after without login in. Not sure if that's Spotify issue
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
With latest version of Meteor, the data.body returns an empty object. the status 200 OK is returned in the headers.
Any idea what would cause this issue?
Is it true?
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
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
here2
is 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?
When calling it I'm getting the following error message:
Exception while invoking method 'getMySavedAlbums' TypeError: Object [object Object] has no method 'getMySavedAlbums'
In the Facebook in app browser this package does not successfully login because it only allows one tab.
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.