Last active
August 29, 2015 14:14
-
-
Save colby/a2515eaf6a6085afaf7d to your computer and use it in GitHub Desktop.
Imgur bash function to upload images
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
# Note: uses some random ClientID for authentication, does not handle errors | |
# Usage: $ imgur ~/Desktop/oleg.png | |
function imgur { | |
[ $# -lt 1 ] && echo "imgur: requires an image file path" && exit 1 | |
curl -sH "Authorization: Client-ID 3e7a4deb7ac67da" -F "image=@$1" "https://api.imgur.com/3/upload" | grep -oE "http:.*\.[a-z]{3,4}" | tr -d '\' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment