Skip to content

Instantly share code, notes, and snippets.

@WindowsCmd
Created March 28, 2021 11:37
Show Gist options
  • Save WindowsCmd/0dcdb0442aa4c87ee6ef7237567f9cf7 to your computer and use it in GitHub Desktop.
Save WindowsCmd/0dcdb0442aa4c87ee6ef7237567f9cf7 to your computer and use it in GitHub Desktop.
Custom flameshot uploader
#!/bin/bash
auth="AUTH"
if [ ! -f "$1" ]
then
exit 1
fi
res=$(curl --silent --show-error \
-H "Authorization: $auth" \
--form "file_image=@$1" \
https://us-west.windy.pink/upload)
json=$(echo $res | jq -r '.data | .url')
if [[ ${json:0:7} == "http://" || ${json:0:8} == "https://" ]]
then
echo -n "$json" | xclip -selection clipboard
else
echo "error"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment