Skip to content

Instantly share code, notes, and snippets.

@shelbyKiraM
Created September 18, 2015 02:25
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 shelbyKiraM/91d7a32dd85b8c394e2f to your computer and use it in GitHub Desktop.
Save shelbyKiraM/91d7a32dd85b8c394e2f to your computer and use it in GitHub Desktop.
function http() {
echo 'Loading...\n'
wget http://http.cat/$1 >/dev/null 2&> $1.chk
grep "ERROR 404" $1.chk >/dev/null
if [ $? = 1 ]; then
mv $1 $1.jpg
qlmanage -p $1.jpg >/dev/null 2&> /dev/null
osascript -e '
tell app "iTerm"
reopen
activate
end tell'
curl http://httpcode.info/$1
rm $1.jpg
else
echo "Code doesn't exist."
fi
rm $1.chk
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment