Skip to content

Instantly share code, notes, and snippets.

@petehamilton
Last active December 19, 2015 07:09
Show Gist options
  • Save petehamilton/5917161 to your computer and use it in GitHub Desktop.
Save petehamilton/5917161 to your computer and use it in GitHub Desktop.
Are exams results online yet?
#!/bin/bash
EXAMS_URL="https://exams.doc.ic.ac.uk/"
echo "##############################################"
echo "# Exam Results Checker"
echo "##############################################"
echo -ne "Username: "
read username
stty -echo
echo -ne "Password: "
read password
stty echo
data=$(curl -s --user $username:'$password' $EXAMS_URL)
while [ true ]
do
echo -ne `date`
new_data=$(curl -s --user $username:'$password' $EXAMS_URL)
if [ $data = $new_data ]
then
echo -e ": \e[0;31mNope :(\e[0m"
else
echo -e ": \e[0;32mOMG YES\! Check it out at $EXAMS_URL\e[0m"
exit 0
fi
data=$new_data
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment