Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2012 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/2819197 to your computer and use it in GitHub Desktop.
Save anonymous/2819197 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Checks a URI for the existance of a troll link.
#
# EXAMPLE USAGE:
# ./pwnt.sh www.youtube.com/watch?v=oHg5SJYRHA0
#
# TODO:
# Realtime Feedback
# Bayesian inference
#
string=$(wget -O - -o /dev/null $1)
found=1
declare -a evil=('roll' 'black' 'friday')
for needle in "${evil[@]}"
do
if [[ "$string" == *"$needle"* ]]; then
echo "contains '$needle'"
found=0
fi
done
if [[ found ]]; then
echo "safe"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment