{"action":"created","issue":{"url":"https://api.github.com/repos/JMPerez/spotify-web-api-js/issues/81","repository_url":"https://api.github.com/repos/JMPerez/spotify-web-api-js","labels_url":"https://api.github.com/repos/JMPerez/spotify-web-api-js/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/JMPerez/spotify-web-api-js/issues/81/comments","events_url":"https://api.github.com/repos/JMPerez/spotify-web-api-js/issues/81/events","html_url":"https://github.com/JMPerez/spotify-web-api-js/issues/81","id":294345011,"number":81,"title":"Promises","user":{"login":"happy-machine","id":33182553,"avatar_url":"https://avatars2.githubusercontent.com/u/33182553?v=4","gravatar_id":"","url":"https://api.github.com/users/happy-machine","html_url":"https://github.com/happy-machine","followers_url":"https://api.github.com/users/happy-machine/followers","following_url":"https://api.github.com/users/happy-machine/following{/other_user}","gists_url":"https://api.github.com/users/happy-machine/gists{/gist_id}","starred_url":"https://api.github.com/users/happy-machine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/happy-machine/subscriptions","organizations_url":"https://api.github.com/users/happy-machine/orgs","repos_url":"https://api.github.com/users/happy-machine/repos","events_url":"https://api.github.com/users/happy-machine/events{/privacy}","received_events_url":"https://api.github.com/users/happy-machine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-05T10:35:57Z","updated_at":"2018-02-05T13:05:31Z","closed_at":null,"author_association":"NONE","body":"Hey : )\r\n\r\nare these compatible with promises?"},"comment":{"url":"https://api.github.com/repos/JMPerez/spotify-web-api-js/issues/comments/363078999","html_url":"https://github.com/JMPerez/spotify-web-api-js/issues/81#issuecomment-363078999","issue_url":"https://api.github.com/repos/JMPerez/spotify-web-api-js/issues/81","id":363078999,"user":{"login":"happy-machine","id":33182553,"avatar_url":"https://avatars2.githubusercontent.com/u/33182553?v=4","gravatar_id":"","url":"https://api.github.com/users/happy-machine","html_url":"https://github.com/happy-machine","followers_url":"https://api.github.com/users/happy-machine/followers","following_url":"https://api.github.com/users/happy-machine/following{/other_user}","gists_url":"https://api.github.com/users/happy-machine/gists{/gist_id}","starred_url":"https://api.github.com/users/happy-machine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/happy-machine/subscriptions","organizations_url":"https://api.github.com/users/happy-machine/orgs","repos_url":"https://api.github.com/users/happy-machine/repos","events_url":"https://api.github.com/users/happy-machine/events{/privacy}","received_events_url":"https://api.github.com/users/happy-machine/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T13:05:31Z","updated_at":"2018-02-05T13:05:31Z","author_association":"NONE","body":"This is getting me some really wierd results. i tried doing it all in one chain aswell.\r\nThis is taking an array of refresh tokens and getting subscription details from it.\r\n\r\nI had other similar issues when trying to run lots of requests, but the same implementation in request worked fine. (I'm sure its my fault but would appreciate help!)\r\n\r\n> function getSubscription(lines){\r\n> console.log(lines)\r\n>    \r\n>         if (lines.length>1){\r\n>            \r\n>            \r\n>             var authOptions = {\r\n> \r\n>                 url: 'https://accounts.spotify.com/api/token',\r\n>                 headers: {\r\n>                   'Authorization': 'Basic ' + (new Buffer(client_id + ':' + client_secret).toString('base64'))\r\n>                 },\r\n>                 form: {\r\n>               \r\n>                   grant_type: 'refresh_token',\r\n>                   refresh_token: lines\r\n>               \r\n>                 },\r\n>               \r\n>                 json: true\r\n>               \r\n>               };\r\n>           \r\n>               \r\n>               request.post(authOptions, function (error, response, body) {\r\n>                      globalToken = body.access_token; \r\n>               \r\n>                     }).then(function(body) {\r\n>                         spotifyApi.setAccessToken(globalToken)\r\n>                         spotifyApi.getMe().then(function(body){\r\n>                             console.log(\"Email: \"+body.body.email+\" Subscription: \"+body.body.product)}.bind({\r\n>                                 refresh_token:refresh_token,spotifyApr:spotifyApi})).catch(function(err){\r\n>                                     console.log(err)})\r\n>             \r\n>            \r\n>                                 }.bind({refresh_token:refresh_token,spotifyApr:spotifyApi})).catch(function(err){console.log(err)})\r\n> \r\n>     \r\n>     }\r\n> }"}}
{"actor":{"display_login":"happy-machine"}}