Created
September 3, 2013 15:23
-
-
Save destroytoday/6425383 to your computer and use it in GitHub Desktop.
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
#Based on Don Southard's "Share with Dropbox" script | |
#http://dirtdon.com | |
#Change this to your CloudApp Username | |
CLOUD_USERNAME="derp" | |
#Change this to your CloudApp Password | |
CLOUD_PASSWORD="derp" | |
URL=`pbpaste` | |
LINK=$(curl -s --digest -u $CLOUD_USERNAME:$CLOUD_PASSWORD \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-d \ | |
'{ | |
"item": { | |
"name": "'$URL'", | |
"redirect_url": "'$URL'" | |
} | |
}' \ | |
"http://my.cl.ly/items") | |
SHARE=`echo $LINK | grep "content_url" | awk 'BEGIN { FS = "," } ; { print $16}' | awk -F\" '{print $(NF-1)}'` | |
echo $SHARE | tr -d '\n' | pbcopy | |
echo $SHARE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment