Created
October 9, 2012 21:36
-
-
Save jjthrash/3861615 to your computer and use it in GitHub Desktop.
OSX->S3 screenshots
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
#!/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