Skip to content

Instantly share code, notes, and snippets.

@xhip
Last active August 29, 2015 14:04
Show Gist options
  • Save xhip/96f85ecc588793a5baf9 to your computer and use it in GitHub Desktop.
Save xhip/96f85ecc588793a5baf9 to your computer and use it in GitHub Desktop.
Prntscr bypass
#!/bin/bash
# ----------------------------------
# Prntscr.sh - Get image link only
# ----------------------------------
URL="$1"
if [ $(echo "$URL" | grep -E "^http:\/\/prntscr.com\/[0-9a-zA-Z]{6}$") ]; then
CODE=$(curl -sf "$URL" | head -n 1 | sed -e 's/.*<meta name="twitter:image:src" content="\([^"]*\)".*/\1/')
echo "prntscr: $CODE"
else
echo "Invalid Link! | Usage: .p <http://prntscr.com/XXXXXX>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment