Created
January 24, 2019 21:27
-
-
Save StefKors/8464e8e7d9575c34fc08a4aad8f52764 to your computer and use it in GitHub Desktop.
return soundcloud id from playlist link
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
</body> | |
<script src="http://connect.soundcloud.com/sdk.js"></script> | |
<script> | |
SC.initialize({ | |
client_id: "id" | |
}); | |
resolveSCPlaylist('https://soundcloud.com/sonicacts/sets/progress-bar-s03e06-28-april') | |
function resolveSCPlaylist(url) { | |
if (!url) { | |
alert('you have to fill the playlist URL input'); | |
return false; | |
} | |
SC.get('/resolve/?url=' + url, { | |
limit: 1 | |
}, function(result) { | |
if (result && result.id) { | |
alert('the playlist id is: ' + result.id); | |
} else { | |
alert('playlist not found'); | |
} | |
}); | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment