Created
March 28, 2021 11:37
-
-
Save WindowsCmd/0dcdb0442aa4c87ee6ef7237567f9cf7 to your computer and use it in GitHub Desktop.
Custom flameshot uploader
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
#!/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