Skip to content

Instantly share code, notes, and snippets.

@destroytoday
Created September 3, 2013 15:23
Show Gist options
  • Save destroytoday/6425383 to your computer and use it in GitHub Desktop.
Save destroytoday/6425383 to your computer and use it in GitHub Desktop.
#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