Skip to content

Instantly share code, notes, and snippets.

@flienteen
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flienteen/9722475 to your computer and use it in GitHub Desktop.
Save flienteen/9722475 to your computer and use it in GitHub Desktop.
#!/bin/bash
CURL=`curl -isF image=@$1 http://static.md/api/v1/get-captcha/ `
TOKEN=`printf "%s\n" "$CURL" | grep "Captcha-Nonce" | awk '{ print $2 }'`
printf "%s\n" "$CURL" | awk 'BEGIN { RS = "\r\n\r\n"; LAST_PART = ""; } END { printf LAST_PART; } { LAST_PART = $0; }'
read -e -p "CAPTCHA: " CAPTCHA
CAPTCHA=$(($CAPTCHA))
LINK=`curl -is -F image="@$1" -F captcha_nonce="$TOKEN" -F captcha_solution="$CAPTCHA" http://static.md/api/v1/upload/ | grep "http"`
echo "Link: $LINK"
echo "$LINK" | xsel --clipboard --input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment