Simply change your upload method and provide it with your user/pass or API keys as necessary.
Post a reply if you have any questions.
# Requires: # scrot (to take the actual screenshot with) # ftp (if using ftp) # sshpass (if using ssh) # s3cmd (if using s3) # imagemagick (is using dropshadow) # xsel (to copy the url to the clipboard) # curl (used for a few things; imageshack, imgur, url shortners, etc) # # Based on a script from Andrew @ LocalCoast (andrew@localcoast.net) # If uploading to s3, be sure to run "s3cmd --configure" to give it your API keys ############################ # Screenshot Configuration # ############################ LOCALDIR="$HOME/.grabup/grabs" # Where are local files stored before upload? DELETELOCAL="false" # Delete the local file once it has been uploaded? "true" or "false" DATE=`date +%Y%m%d%H%M%S` # Date format DROPSHADOW="true" # Use ImageMagick? "true" or "false" ######################## # Upload Configuration # ######################## DOMAIN="" # Domain (or S3 bucket) used to upload your grabs to UPLOADMETHOD="" # Your choice of upload method; "ftp", "ssh", "imageshack", "imgur", "s3" S3_CUSTOMURL="" # Use the "LONGURL" specified below for S3? Use this if you have a CNAME; "true" or "false" SERVER_USER="" # Server username SERVER_PASS="" # Server password SERVER_GDIR="" # Where grabs are stored on the server (SSH or FTP only) UPLOAD_APIK="" # API key to be used with imgur, etc LONGURL="http://$DOMAIN/$DATE.png" # Typically "http://$DOMAIN/$DATE.png". Blank for ImageShack, Imgur. ############################## # URL Shortner Configuration # ############################## URLMETHOD="" # How you want URLs to be copied to your clipboard; "long", "tinyurl", "isgd", or "bitly" URL_APIU="" # API Key: Required for Bitly: http://bit.ly/a/your_api_key URL_APIK="" # API Key: Required for Bitly ############################################################# ########## START THE SCREENSHOT AND UPLOAD PROCESS ########## ############################################################# ############################################################# ########## You do not want to edit past here ########## ########## unless you know what you are doing ########## ############################################################# # Take screenshot BASENAME="$DATE.png" FILENAME="$LOCALDIR/$BASENAME" scrot -s $FILENAME # Add drop-shadow if [ "$DROPSHADOW" = "true" ]; then convert $FILENAME -gravity northwest -background 'rgba(255,255,255,0)' -splice 10x10 \ \( +clone -background gray -shadow 80x12-1-1 \) +swap -background none -mosaic +repage \ \( +clone -background gray -shadow 80x12+5+5 \) +swap -background none -mosaic +repage $FILENAME fi # Upload if [ "$UPLOADMETHOD" = "ftp" ]; then cd $LOCALDIR ftp -n -v $DOMAIN << DONEWITHFTP user $SERVER_USER $SERVER_PASS cd $SERVER_GDIR put $BASENAME bye DONEWITHFTP fi if [ "$UPLOADMETHOD" = "ssh" ]; then sshpass -p $SSH_PASS scp -P 22 $FILENAME $SERVER_USER@$DOMAIN:$SERVER_GDIR fi if [ "$UPLOADMETHOD" = "imageshack" ]; then LONGURL=`curl -H Expect: -F fileupload="@$FILENAME" -F xml=yes -# "http://www.imageshack.us/index.php" | grep image_link | grep -o http[^\<]*` fi if [ "$UPLOADMETHOD" = "imgur" ]; then LONGURL=`curl -F "image=@$FILENAME" -F "key=$UPLOAD_APIK" http://api.imgur.com/2/upload.xml | grep -o http[^\<]* | grep png` echo $LONGURL fi if [ "$UPLOADMETHOD" = "s3" ]; then S3PUBLIC=`s3cmd put --acl-public --guess-mime-type $FILENAME s3://$DOMAIN/$BASENAME | grep -o http[^\<]*` if [ "$S3_CUSTOMURL" = "false" ]; then LONGURL=$S3PUBLIC else LONGURL=$LONGURL fi fi # Generate short URL (if configured) and copy to clipboard if [ "$URLMETHOD" = "long" ]; then echo "$LONGURL" | xsel --clipboard --input fi if [ "$URLMETHOD" = "tinyurl" ]; then TINYURL_GEN="http://tinyurl.com/api-create.php?url=$LONGURL" TINYURL_URL=`curl $TINYURL_GEN` echo "$TINYURL_URL" | xsel --clipboard --input fi if [ "$URLMETHOD" = "isgd" ]; then ISGD_GEN="http://is.gd/api.php?longurl=$LONGURL" ISGD_URL=`curl $ISGD_GEN` echo "$ISGD_URL" | xsel --clipboard --input fi if [ "$URLMETHOD" = "bitly" ]; then BITLY_GEN="http://api.bit.ly/v3/shorten?login=$URL_APIU&apiKey=$URL_APIK&format=txt&longUrl=$LONGURL" BITLY_URL=`curl $BITLY_GEN` echo "$BITLY_URL" | xsel --clipboard --input fi # Delete the local file if [ "$DELETELOCAL" = "true" ]; then rm $LOCALDIR/$BASENAME fi

Sign In »
Register Now!
Help

Back to top
MultiQuote