Skip to content

Instantly share code, notes, and snippets.

@jjthrash
Created October 9, 2012 21:36
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 jjthrash/3861615 to your computer and use it in GitHub Desktop.
Save jjthrash/3861615 to your computer and use it in GitHub Desktop.
OSX->S3 screenshots
#!/bin/bash
# Install the Deps:
# brew install s3cmd
# s3cmd --configure
#
# Usage:
# <script_name> some-prefix | pbcopy
set -e
BUCKET=your-bucket-here
function uploadAndGetURL {
s3cmd put --acl-public --guess-mime-type $1 s3://$BUCKET/$1 | grep Public | sed 's/.*http/http/'
}
if [ -z "$1" ]; then
echo "Please specify a screenshot prefix" >&2
exit 1
fi
FILENAME=`date "+$1-%Y%m%d%H%M%S"`
screencapture -i "$FILENAME.png"
uploadAndGetURL "$FILENAME.png" #| pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment