blue

Modify routes/api.js

1 const SpotifyWebApi = require('spotify-web-api-node'); // spotify api 1 const SpotifyWebApi = require('spotify-web-api-node'); // spotify api
2 //const { search } = require('.'); 2 //const { search } = require('.');
3 var spotifyApi = new SpotifyWebApi({ 3 var spotifyApi = new SpotifyWebApi({
4 - clientId: "faf7865d62b5488da2f6bca05e63a075", //your id 4 + clientId: "your id",
5 - clientSecret: "b888f07e8986499aa70950b0235d81eb", //your secret 5 + clientSecret: "your secret",
6 - redirectUri: 'http://localhost:3000/callback' //redirectUri 6 + redirectUri: 'redirectUri'
7 }); 7 });
8 8
9 const scopes = [ 9 const scopes = [
...@@ -105,12 +105,6 @@ function getArtist(artistid,callback){ ...@@ -105,12 +105,6 @@ function getArtist(artistid,callback){
105 }); 105 });
106 } 106 }
107 module.exports.getArtist = getArtist; 107 module.exports.getArtist = getArtist;
108 -//followers.total
109 -//images[0]
110 -//name
111 -//popularity
112 -//id
113 -// Get albums by a certain artist
114 108
115 function getArtistAlbums(artistid,callback){ 109 function getArtistAlbums(artistid,callback){
116 spotifyApi.getArtistAlbums(artistid) 110 spotifyApi.getArtistAlbums(artistid)
...@@ -122,23 +116,3 @@ function getArtistAlbums(artistid,callback){ ...@@ -122,23 +116,3 @@ function getArtistAlbums(artistid,callback){
122 }); 116 });
123 } 117 }
124 module.exports.getArtistAlbums = getArtistAlbums; 118 module.exports.getArtistAlbums = getArtistAlbums;
125 -
126 -
127 -// function search(){
128 -// SearchUrl = `https://open.spotify.com/artist/4kyWODlwZxF4tiAe4LblhX`
129 -// request(SearchUrl, (error, response, body) => {
130 -// var data = body;
131 -// console.log(body)
132 -// // for (var j = 0; j < 10; j++) {
133 -// // var team_id = data["info"]["participants"][j]["teamId"]
134 -// // if (p_id == summoner_puuid) {
135 -// // my_info["kills"] += match["info"]["participants"][j]["kills"]
136 -// // win = match["info"]["participants"][j]["win"];
137 -// // }
138 -// // }
139 -// })
140 -// }
141 -// module.exports.search = search;
142 -// var item = data.body.artists.items.find((item,idx)=>{
143 - // item.popularity == "0";
144 - // });
...\ No newline at end of file ...\ No newline at end of file
......