Created
August 2, 2012 08:58
-
-
Save thumphries/3235589 to your computer and use it in GitHub Desktop.
lol
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
#!/bin/bash | |
baseu="http://www.handbook.unsw.edu.au/vbook2012/brCoursesByAtoZ.jsp?StudyLevel=Undergraduate&descr=" | |
basep="http://www.handbook.unsw.edu.au/vbook2012/brCoursesByAtoZ.jsp?StudyLevel=Postgraduate&descr=" | |
if [[ ! $1 =~ ^[A-Z]{4} ]] || [ $# -eq 0 ]; then | |
echo "Usage: ./$0 TYPE" | |
else | |
baseu+="${1:0:1}" | |
basep+="${1:0:1}" | |
wget -q -O- $baseu $basep | w3m -dump -cols 150 -T "text/html" | grep -e "^$1" | sort | uniq | \ | |
sed -re "s/[ \t]+[0-9]+$//g;s/[ \t]{2,}/ /g" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment