commit
34fe0b0eb2
2
img.sh
2
img.sh
|
@ -9,4 +9,4 @@ scrot -z "$@" $img >/dev/null 2>&1 || exit
|
|||
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
|
||||
|
||||
echo $res | grep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g')
|
||||
test -n "$link" && (printf $link | xclip; printf "\a") || echo "$res" > "$img.error"
|
||||
test -n "$link" && (printf $link | xclip; printf "\a" && rm "$img") || echo "$res" > "$img.error"
|
||||
|
|
Loading…
Reference in New Issue