Skip to content

Instantly share code, notes, and snippets.

@flienteen flienteen/staticmd.sh
Last active Aug 29, 2015

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.