Last active
May 26, 2017 09:47
-
-
Save alenbasic/2c2733c9759e2ee7079c to your computer and use it in GitHub Desktop.
A simple hackish script that uploads pictures to imgur. Improve and expand from here.
This file contains hidden or 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
screenshot="$1" | |
client_id="" # get your clientid here: https://api.imgur.com/oauth2/addclient | |
response=$(curl -silent -H "Authorization: Client-ID $client_id" -F "image=@${screenshot}" https://api.imgur.com/3/image.json) | |
url=$(echo $response | awk '{split($0,a,","); print a[48]}' | sed 's/\(\\\|"link":\|}\|"\)//g') | |
deletehash=$(echo $response | awk '{split($0,a,","); print a[46]}' | sed 's/\("deletehash":\|"\)//g') | |
echo "$url" | xclip -selection c # needs xclip installed, available most linux distros | |
echo "$url" | |
echo "deletion page: http://imgur.com/api/delete/${deletehash}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment