Created
September 24, 2012 15:53
-
-
Save acroca/3776675 to your computer and use it in GitHub Desktop.
Copy Dropbox public URL bash script
This file contains 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
# 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 |
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
I normally attach the image file to tracker comment and copy the link from it ;p