api - SoundCloud: I need a function to extract a var for artwork_url from any permalink_url to insert in a DB -
my permalink_url example "https://soundcloud.com/rac/sets/rac-chapter-one". need function produce artwork_url variable permalink url. similar thiscode lifted soundcloud docs, expressed function:
<script src="http://connect.soundcloud.com/sdk.js"></script> sc.initialize({ client_id: 'your_client_id' }); // permalink track var track_url = 'https://soundcloud.com/rac/sets/rac-chapter-one'; sc.get('/resolve', { url: track_url }, function(track) { sc.get('/tracks/' + track.id + '/comments', function(comments) { (var = 0; < comments.length; i++) { console.log('someone said: ' + comments[i].body); } }); }); </script>
i barely capable player type of coding, , appreciate practical help. cheers!
you have artwork_url
property sound representation:
<script src="http://connect.soundcloud.com/sdk.js"></script> sc.initialize({ client_id: 'your_client_id' }); // permalink track var track_url = 'https://soundcloud.com/rac/sets/rac-chapter-one'; sc.get('/resolve', { url: track_url }, function(track) { console.log(track.artwork_url); }); </script>