Created
September 18, 2015 02:25
-
-
Save shelbyKiraM/91d7a32dd85b8c394e2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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