Created
September 4, 2015 15:35
-
-
Save Benzi/5becf2883b0f273694f5 to your computer and use it in GitHub Desktop.
You can use this to get the Soundcloud permalink from a track ID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var client_id = ''; // Insert client ID | |
| var track_id = ''; // Insert track ID | |
| var url = 'https://api.soundcloud.com/tracks/' + track_id + '?client_id=' + client_id; | |
| var https = require('https'); | |
| https.get(url, function(res) { | |
| var json = ''; | |
| res.on('data', function(data) { | |
| json += data; | |
| }); | |
| res.on('end', function() { | |
| json = JSON.parse(json); | |
| console.log(json.permalink_url); | |
| }); | |
| }).on('error', function(e) { | |
| console.log('Error: ', e); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment