Created
May 28, 2013 18:02
-
-
Save bmoore/5664730 to your computer and use it in GitHub Desktop.
Upload image selection to imgur, and pipe the image url to xclip. Based on http://sirupsen.com/a-simple-imgur-bash-screenshot-utility/
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 | |
function uploadImage { | |
curl -s -F "image=@$1" -F "key=486690f872c678126a2c09a9e196ce1b" https://imgur.com/api/upload.xml | grep -E -o "<original_image>(.)*</original_image>" | grep -E -o "http://i.imgur.com/[^<]*" | |
} | |
import shot.png | |
url=`uploadImage "shot.png"` | |
echo $url | |
echo $url | xclip -selection c | |
rm shot.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends upon imagemagick's import utility, curl, grep, and xclip