Skip to content

Instantly share code, notes, and snippets.

@acroca
Created September 24, 2012 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acroca/3776675 to your computer and use it in GitHub Desktop.
Save acroca/3776675 to your computer and use it in GitHub Desktop.
Copy Dropbox public URL bash script
# This script copies the public from the last updated file in your Dropbox public folder.
# I use it to add screenshots in pull request description.
#
# Set DROPBOX_USER_ID with the user_id you get when generating public urls
# Replace the path ~/Dropbox/Public with your Dropbox public folder.
dropbox_public_url() {
last_db_item="`find ~/Dropbox/Public -type f -exec stat -f '%m %N' {} \; | sort -n | tail -1 | cut -f2- -d' ' | awk '{ gsub(/.*Public/, \"\"); print }'`"
echo "https://dl.dropbox.com/u/$DROPBOX_USER_ID$last_db_item" | pbcopy
}
export -f dropbox_public_url
@visibletrap
Copy link

I normally attach the image file to tracker comment and copy the link from it ;p

@visibletrap
Copy link

Oh just realize that it gets expired :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment