Created
October 3, 2013 17:09
-
-
Save RobertAudi/6813340 to your computer and use it in GitHub Desktop.
Function to get the track URL for a SoundCloud track and copy it to the clipboard on OS X. Requires `jq` (`brew install jq`)
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
scurl() { | |
curl "http://api.soundcloud.com/resolve.json?url=$1&client_id=[SOUNDCLOUD_API_CLIENT_ID]" 2> /dev/null | jq '.location' | awk -F '\?' '{print $1}' | sed 's/\.json$//' | sed 's/^"//' | tr -d '\n' | pbcopy | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment