Skip to content

Instantly share code, notes, and snippets.

@jyn514
Created June 28, 2018 21:23
Show Gist options
  • Save jyn514/e5b139c4c85f43bcec1ac3ae391deab3 to your computer and use it in GitHub Desktop.
Save jyn514/e5b139c4c85f43bcec1ac3ae391deab3 to your computer and use it in GitHub Desktop.
make recipies for gradeforge
% make -n --always-make| tee output.txt
mkdir webpages
python -m gradeforge download catalog > webpages/catalog.html
if grep '404 page not found' webpages/catalog.html; then echo file "'webpages/catalog.html'" gave a 404 not found; rm -f webpages/catalog.html; exit 999; fi
sed -i 's/\s\+$//' webpages/catalog.html
python -m gradeforge parse catalog --department-output catalog.departments.csv webpages/catalog.html catalog.csv
mkdir grades
python -m gradeforge download \
--season `echo grades/Fall-2008-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2008-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2008-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2008-Columbia.pdf
pdftotext -layout grades/Fall-2008-Columbia.pdf
python -m gradeforge parse grades grades/Fall-2008-Columbia.txt grades/Fall-2008-Columbia.csv
python -m gradeforge download \
--season `echo grades/Fall-2009-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2009-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2009-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2009-Columbia.pdf
pdftotext -layout grades/Fall-2009-Columbia.pdf
python -m gradeforge parse grades grades/Fall-2009-Columbia.txt grades/Fall-2009-Columbia.csv
python -m gradeforge download \
--season `echo grades/Fall-2010-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2010-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2010-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2010-Columbia.pdf
pdftotext -layout grades/Fall-2010-Columbia.pdf
python -m gradeforge parse grades grades/Fall-2010-Columbia.txt grades/Fall-2010-Columbia.csv
python -m gradeforge download \
--season `echo grades/Fall-2011-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2011-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2011-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2011-Columbia.pdf
pdftotext -layout grades/Fall-2011-Columbia.pdf
python -m gradeforge parse grades grades/Fall-2011-Columbia.txt grades/Fall-2011-Columbia.csv
python -m gradeforge download \
--season `echo grades/Fall-2012-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2012-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2012-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2012-Columbia.pdf
pdftotext -layout grades/Fall-2012-Columbia.pdf
python -m gradeforge parse grades grades/Fall-2012-Columbia.txt grades/Fall-2012-Columbia.csv
python -m gradeforge download \
--season `echo grades/Fall-2008-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2008-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2008-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2008-Aiken.pdf
pdftotext -layout grades/Fall-2008-Aiken.pdf
python -m gradeforge parse grades grades/Fall-2008-Aiken.txt grades/Fall-2008-Aiken.csv
python -m gradeforge download \
--season `echo grades/Fall-2009-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2009-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2009-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2009-Aiken.pdf
pdftotext -layout grades/Fall-2009-Aiken.pdf
python -m gradeforge parse grades grades/Fall-2009-Aiken.txt grades/Fall-2009-Aiken.csv
python -m gradeforge download \
--season `echo grades/Fall-2010-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2010-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2010-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2010-Aiken.pdf
pdftotext -layout grades/Fall-2010-Aiken.pdf
python -m gradeforge parse grades grades/Fall-2010-Aiken.txt grades/Fall-2010-Aiken.csv
python -m gradeforge download \
--season `echo grades/Fall-2011-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2011-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2011-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2011-Aiken.pdf
pdftotext -layout grades/Fall-2011-Aiken.pdf
python -m gradeforge parse grades grades/Fall-2011-Aiken.txt grades/Fall-2011-Aiken.csv
python -m gradeforge download \
--season `echo grades/Fall-2012-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2012-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2012-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2012-Aiken.pdf
pdftotext -layout grades/Fall-2012-Aiken.pdf
python -m gradeforge parse grades grades/Fall-2012-Aiken.txt grades/Fall-2012-Aiken.csv
python -m gradeforge download \
--season `echo grades/Fall-2008-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2008-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2008-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2008-Upstate.pdf
pdftotext -layout grades/Fall-2008-Upstate.pdf
python -m gradeforge parse grades grades/Fall-2008-Upstate.txt grades/Fall-2008-Upstate.csv
python -m gradeforge download \
--season `echo grades/Fall-2009-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2009-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2009-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2009-Upstate.pdf
pdftotext -layout grades/Fall-2009-Upstate.pdf
python -m gradeforge parse grades grades/Fall-2009-Upstate.txt grades/Fall-2009-Upstate.csv
python -m gradeforge download \
--season `echo grades/Fall-2010-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2010-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2010-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2010-Upstate.pdf
pdftotext -layout grades/Fall-2010-Upstate.pdf
python -m gradeforge parse grades grades/Fall-2010-Upstate.txt grades/Fall-2010-Upstate.csv
python -m gradeforge download \
--season `echo grades/Fall-2011-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2011-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2011-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2011-Upstate.pdf
pdftotext -layout grades/Fall-2011-Upstate.pdf
python -m gradeforge parse grades grades/Fall-2011-Upstate.txt grades/Fall-2011-Upstate.csv
python -m gradeforge download \
--season `echo grades/Fall-2012-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2012-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Fall-2012-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Fall-2012-Upstate.pdf
pdftotext -layout grades/Fall-2012-Upstate.pdf
python -m gradeforge parse grades grades/Fall-2012-Upstate.txt grades/Fall-2012-Upstate.csv
python -m gradeforge download \
--season `echo grades/Spring-2008-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2008-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2008-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2008-Columbia.pdf
pdftotext -layout grades/Spring-2008-Columbia.pdf
python -m gradeforge parse grades grades/Spring-2008-Columbia.txt grades/Spring-2008-Columbia.csv
python -m gradeforge download \
--season `echo grades/Spring-2009-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2009-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2009-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2009-Columbia.pdf
pdftotext -layout grades/Spring-2009-Columbia.pdf
python -m gradeforge parse grades grades/Spring-2009-Columbia.txt grades/Spring-2009-Columbia.csv
python -m gradeforge download \
--season `echo grades/Spring-2010-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2010-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2010-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2010-Columbia.pdf
pdftotext -layout grades/Spring-2010-Columbia.pdf
python -m gradeforge parse grades grades/Spring-2010-Columbia.txt grades/Spring-2010-Columbia.csv
python -m gradeforge download \
--season `echo grades/Spring-2011-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2011-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2011-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2011-Columbia.pdf
pdftotext -layout grades/Spring-2011-Columbia.pdf
python -m gradeforge parse grades grades/Spring-2011-Columbia.txt grades/Spring-2011-Columbia.csv
python -m gradeforge download \
--season `echo grades/Spring-2012-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2012-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2012-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2012-Columbia.pdf
pdftotext -layout grades/Spring-2012-Columbia.pdf
python -m gradeforge parse grades grades/Spring-2012-Columbia.txt grades/Spring-2012-Columbia.csv
python -m gradeforge download \
--season `echo grades/Spring-2013-Columbia.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2013-Columbia.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2013-Columbia.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2013-Columbia.pdf
pdftotext -layout grades/Spring-2013-Columbia.pdf
python -m gradeforge parse grades grades/Spring-2013-Columbia.txt grades/Spring-2013-Columbia.csv
python -m gradeforge download \
--season `echo grades/Spring-2008-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2008-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2008-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2008-Aiken.pdf
pdftotext -layout grades/Spring-2008-Aiken.pdf
python -m gradeforge parse grades grades/Spring-2008-Aiken.txt grades/Spring-2008-Aiken.csv
python -m gradeforge download \
--season `echo grades/Spring-2009-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2009-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2009-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2009-Aiken.pdf
pdftotext -layout grades/Spring-2009-Aiken.pdf
python -m gradeforge parse grades grades/Spring-2009-Aiken.txt grades/Spring-2009-Aiken.csv
python -m gradeforge download \
--season `echo grades/Spring-2010-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2010-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2010-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2010-Aiken.pdf
pdftotext -layout grades/Spring-2010-Aiken.pdf
python -m gradeforge parse grades grades/Spring-2010-Aiken.txt grades/Spring-2010-Aiken.csv
python -m gradeforge download \
--season `echo grades/Spring-2011-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2011-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2011-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2011-Aiken.pdf
pdftotext -layout grades/Spring-2011-Aiken.pdf
python -m gradeforge parse grades grades/Spring-2011-Aiken.txt grades/Spring-2011-Aiken.csv
python -m gradeforge download \
--season `echo grades/Spring-2012-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2012-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2012-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2012-Aiken.pdf
pdftotext -layout grades/Spring-2012-Aiken.pdf
python -m gradeforge parse grades grades/Spring-2012-Aiken.txt grades/Spring-2012-Aiken.csv
python -m gradeforge download \
--season `echo grades/Spring-2013-Aiken.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2013-Aiken.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2013-Aiken.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2013-Aiken.pdf
pdftotext -layout grades/Spring-2013-Aiken.pdf
python -m gradeforge parse grades grades/Spring-2013-Aiken.txt grades/Spring-2013-Aiken.csv
python -m gradeforge download \
--season `echo grades/Spring-2008-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2008-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2008-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2008-Upstate.pdf
pdftotext -layout grades/Spring-2008-Upstate.pdf
python -m gradeforge parse grades grades/Spring-2008-Upstate.txt grades/Spring-2008-Upstate.csv
python -m gradeforge download \
--season `echo grades/Spring-2009-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2009-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2009-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2009-Upstate.pdf
pdftotext -layout grades/Spring-2009-Upstate.pdf
python -m gradeforge parse grades grades/Spring-2009-Upstate.txt grades/Spring-2009-Upstate.csv
python -m gradeforge download \
--season `echo grades/Spring-2010-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2010-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2010-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2010-Upstate.pdf
pdftotext -layout grades/Spring-2010-Upstate.pdf
python -m gradeforge parse grades grades/Spring-2010-Upstate.txt grades/Spring-2010-Upstate.csv
python -m gradeforge download \
--season `echo grades/Spring-2011-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2011-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2011-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2011-Upstate.pdf
pdftotext -layout grades/Spring-2011-Upstate.pdf
python -m gradeforge parse grades grades/Spring-2011-Upstate.txt grades/Spring-2011-Upstate.csv
python -m gradeforge download \
--season `echo grades/Spring-2012-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2012-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2012-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2012-Upstate.pdf
pdftotext -layout grades/Spring-2012-Upstate.pdf
python -m gradeforge parse grades grades/Spring-2012-Upstate.txt grades/Spring-2012-Upstate.csv
python -m gradeforge download \
--season `echo grades/Spring-2013-Upstate.pdf | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2013-Upstate.pdf | cut -d. -f1 | cut -d- -f2` \
grades `echo grades/Spring-2013-Upstate.pdf | cut -d. -f1 | cut -d- -f3` > grades/Spring-2013-Upstate.pdf
pdftotext -layout grades/Spring-2013-Upstate.pdf
python -m gradeforge parse grades grades/Spring-2013-Upstate.txt grades/Spring-2013-Upstate.csv
python -m gradeforge download \
--season `echo grades/Summer-2014.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Summer-2014.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Summer-2014.xlsx
xlsx2csv grades/Summer-2014.xlsx grades/Summer-2014.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Summer-2014.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Summer-2014.csv
sed -i "2,$ s/^/201405,,/" grades/Summer-2014.csv
python -m gradeforge download \
--season `echo grades/Summer-2015.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Summer-2015.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Summer-2015.xlsx
xlsx2csv grades/Summer-2015.xlsx grades/Summer-2015.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Summer-2015.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Summer-2015.csv
sed -i "2,$ s/^/201505,,/" grades/Summer-2015.csv
python -m gradeforge download \
--season `echo grades/Summer-2016.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Summer-2016.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Summer-2016.xlsx
xlsx2csv grades/Summer-2016.xlsx grades/Summer-2016.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Summer-2016.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Summer-2016.csv
sed -i "2,$ s/^/201605,,/" grades/Summer-2016.csv
python -m gradeforge download \
--season `echo grades/Summer-2017.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Summer-2017.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Summer-2017.xlsx
xlsx2csv grades/Summer-2017.xlsx grades/Summer-2017.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Summer-2017.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Summer-2017.csv
sed -i "2,$ s/^/201705,,/" grades/Summer-2017.csv
python -m gradeforge download \
--season `echo grades/Fall-2013.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2013.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Fall-2013.xlsx
xlsx2csv grades/Fall-2013.xlsx grades/Fall-2013.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Fall-2013.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Fall-2013.csv
sed -i "2,$ s/^/201341,,/" grades/Fall-2013.csv
python -m gradeforge download \
--season `echo grades/Fall-2014.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2014.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Fall-2014.xlsx
xlsx2csv grades/Fall-2014.xlsx grades/Fall-2014.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Fall-2014.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Fall-2014.csv
sed -i "2,$ s/^/201408,,/" grades/Fall-2014.csv
python -m gradeforge download \
--season `echo grades/Fall-2015.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2015.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Fall-2015.xlsx
xlsx2csv grades/Fall-2015.xlsx grades/Fall-2015.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Fall-2015.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Fall-2015.csv
sed -i "2,$ s/^/201508,,/" grades/Fall-2015.csv
python -m gradeforge download \
--season `echo grades/Fall-2016.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2016.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Fall-2016.xlsx
xlsx2csv grades/Fall-2016.xlsx grades/Fall-2016.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Fall-2016.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Fall-2016.csv
sed -i "2,$ s/^/201608,,/" grades/Fall-2016.csv
python -m gradeforge download \
--season `echo grades/Fall-2017.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Fall-2017.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Fall-2017.xlsx
xlsx2csv grades/Fall-2017.xlsx grades/Fall-2017.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Fall-2017.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Fall-2017.csv
sed -i "2,$ s/^/201708,,/" grades/Fall-2017.csv
python -m gradeforge download \
--season `echo grades/Spring-2014.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2014.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Spring-2014.xlsx
xlsx2csv grades/Spring-2014.xlsx grades/Spring-2014.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Spring-2014.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Spring-2014.csv
sed -i "2,$ s/^/201401,,/" grades/Spring-2014.csv
python -m gradeforge download \
--season `echo grades/Spring-2015.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2015.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Spring-2015.xlsx
xlsx2csv grades/Spring-2015.xlsx grades/Spring-2015.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Spring-2015.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Spring-2015.csv
sed -i "2,$ s/^/201501,,/" grades/Spring-2015.csv
python -m gradeforge download \
--season `echo grades/Spring-2016.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2016.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Spring-2016.xlsx
xlsx2csv grades/Spring-2016.xlsx grades/Spring-2016.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Spring-2016.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Spring-2016.csv
sed -i "2,$ s/^/201601,,/" grades/Spring-2016.csv
python -m gradeforge download \
--season `echo grades/Spring-2017.xlsx | cut -d. -f1 | cut -d/ -f2 | cut -d- -f1` \
--year `echo grades/Spring-2017.xlsx | cut -d. -f1 | cut -d- -f2` \
grades > grades/Spring-2017.xlsx
xlsx2csv grades/Spring-2017.xlsx grades/Spring-2017.csv
sed -i '1 s/\([A-DF]+?\)_GF/\1/g; 1 s/COURSE_SECTION/SECTION/; 1 s/_NUMBER//g; 1 s/No ?Grade/No Grade/; 1 s/Num Grades Posted/TOTAL/; 1 s/Incomplete/INCOMPLETE/i; 1 s/SUBJECT/DEPARTMENT/; 1 s/COURSE/CODE/' grades/Spring-2017.csv
sed -i '1 s/^/SEMESTER,CAMPUS,/' grades/Spring-2017.csv
sed -i "2,$ s/^/201701,,/" grades/Spring-2017.csv
python -m gradeforge combine grades grades/Fall-2008-Columbia.csv grades/Fall-2009-Columbia.csv grades/Fall-2010-Columbia.csv grades/Fall-2011-Columbia.csv grades/Fall-2012-Columbia.csv grades/Fall-2008-Aiken.csv grades/Fall-2009-Aiken.csv grades/Fall-2010-Aiken.csv grades/Fall-2011-Aiken.csv grades/Fall-2012-Aiken.csv grades/Fall-2008-Upstate.csv grades/Fall-2009-Upstate.csv grades/Fall-2010-Upstate.csv grades/Fall-2011-Upstate.csv grades/Fall-2012-Upstate.csv grades/Spring-2008-Columbia.csv grades/Spring-2009-Columbia.csv grades/Spring-2010-Columbia.csv grades/Spring-2011-Columbia.csv grades/Spring-2012-Columbia.csv grades/Spring-2013-Columbia.csv grades/Spring-2008-Aiken.csv grades/Spring-2009-Aiken.csv grades/Spring-2010-Aiken.csv grades/Spring-2011-Aiken.csv grades/Spring-2012-Aiken.csv grades/Spring-2013-Aiken.csv grades/Spring-2008-Upstate.csv grades/Spring-2009-Upstate.csv grades/Spring-2010-Upstate.csv grades/Spring-2011-Upstate.csv grades/Spring-2012-Upstate.csv grades/Spring-2013-Upstate.csv grades/Summer-2014.csv grades/Summer-2015.csv grades/Summer-2016.csv grades/Summer-2017.csv grades/Fall-2013.csv grades/Fall-2014.csv grades/Fall-2015.csv grades/Fall-2016.csv grades/Fall-2017.csv grades/Spring-2014.csv grades/Spring-2015.csv grades/Spring-2016.csv grades/Spring-2017.csv > grades.csv
mkdir exams
python -m gradeforge download \
--season `echo Fall-2016 | cut -d- -f1` \
--year `echo Fall-2016 | cut -d- -f2`\
exam > exams/Fall-2016.html
if grep '404 page not found' exams/Fall-2016.html; then echo file "'exams/Fall-2016.html'" gave a 404 not found; rm -f exams/Fall-2016.html; exit 999; fi
sed -i 's/\s\+$//' exams/Fall-2016.html
python -m gradeforge parse exam exams/Fall-2016.html exams/Fall-2016.csv
python -m gradeforge download \
--season `echo Fall-2017 | cut -d- -f1` \
--year `echo Fall-2017 | cut -d- -f2`\
exam > exams/Fall-2017.html
if grep '404 page not found' exams/Fall-2017.html; then echo file "'exams/Fall-2017.html'" gave a 404 not found; rm -f exams/Fall-2017.html; exit 999; fi
sed -i 's/\s\+$//' exams/Fall-2017.html
python -m gradeforge parse exam exams/Fall-2017.html exams/Fall-2017.csv
python -m gradeforge download \
--season `echo Fall-2018 | cut -d- -f1` \
--year `echo Fall-2018 | cut -d- -f2`\
exam > exams/Fall-2018.html
if grep '404 page not found' exams/Fall-2018.html; then echo file "'exams/Fall-2018.html'" gave a 404 not found; rm -f exams/Fall-2018.html; exit 999; fi
sed -i 's/\s\+$//' exams/Fall-2018.html
python -m gradeforge parse exam exams/Fall-2018.html exams/Fall-2018.csv
python -m gradeforge download \
--season `echo Summer-2016 | cut -d- -f1` \
--year `echo Summer-2016 | cut -d- -f2`\
exam > exams/Summer-2016.html
if grep '404 page not found' exams/Summer-2016.html; then echo file "'exams/Summer-2016.html'" gave a 404 not found; rm -f exams/Summer-2016.html; exit 999; fi
sed -i 's/\s\+$//' exams/Summer-2016.html
python -m gradeforge parse exam exams/Summer-2016.html exams/Summer-2016.csv
python -m gradeforge download \
--season `echo Summer-2017 | cut -d- -f1` \
--year `echo Summer-2017 | cut -d- -f2`\
exam > exams/Summer-2017.html
if grep '404 page not found' exams/Summer-2017.html; then echo file "'exams/Summer-2017.html'" gave a 404 not found; rm -f exams/Summer-2017.html; exit 999; fi
sed -i 's/\s\+$//' exams/Summer-2017.html
python -m gradeforge parse exam exams/Summer-2017.html exams/Summer-2017.csv
python -m gradeforge download \
--season `echo Summer-2018 | cut -d- -f1` \
--year `echo Summer-2018 | cut -d- -f2`\
exam > exams/Summer-2018.html
if grep '404 page not found' exams/Summer-2018.html; then echo file "'exams/Summer-2018.html'" gave a 404 not found; rm -f exams/Summer-2018.html; exit 999; fi
sed -i 's/\s\+$//' exams/Summer-2018.html
python -m gradeforge parse exam exams/Summer-2018.html exams/Summer-2018.csv
python -m gradeforge download \
--season `echo Spring-2017 | cut -d- -f1` \
--year `echo Spring-2017 | cut -d- -f2`\
exam > exams/Spring-2017.html
if grep '404 page not found' exams/Spring-2017.html; then echo file "'exams/Spring-2017.html'" gave a 404 not found; rm -f exams/Spring-2017.html; exit 999; fi
sed -i 's/\s\+$//' exams/Spring-2017.html
python -m gradeforge parse exam exams/Spring-2017.html exams/Spring-2017.csv
python -m gradeforge download \
--season `echo Spring-2018 | cut -d- -f1` \
--year `echo Spring-2018 | cut -d- -f2`\
exam > exams/Spring-2018.html
if grep '404 page not found' exams/Spring-2018.html; then echo file "'exams/Spring-2018.html'" gave a 404 not found; rm -f exams/Spring-2018.html; exit 999; fi
sed -i 's/\s\+$//' exams/Spring-2018.html
python -m gradeforge parse exam exams/Spring-2018.html exams/Spring-2018.csv
head -1 exams/Fall-2016.csv > exams.csv # headers
for exam in exams/Fall-2016.csv exams/Fall-2017.csv exams/Fall-2018.csv exams/Summer-2016.csv exams/Summer-2017.csv exams/Summer-2018.csv exams/Spring-2017.csv exams/Spring-2018.csv; do tail -n+2 $exam >> exams.csv; done
mkdir sections
# keep original because we'll be changing it in a second
python -m gradeforge download --season Fall --year 2013 sections > sections/Fall-2013.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Fall-2013.html.bak > sections/Fall-2013.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Fall-2013.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Fall-2013.instructors.csv \
--term-output sections/Fall-2013.terms.csv \
sections/Fall-2013.html sections/Fall-2013.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Fall --year 2014 sections > sections/Fall-2014.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Fall-2014.html.bak > sections/Fall-2014.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Fall-2014.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Fall-2014.instructors.csv \
--term-output sections/Fall-2014.terms.csv \
sections/Fall-2014.html sections/Fall-2014.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Fall --year 2015 sections > sections/Fall-2015.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Fall-2015.html.bak > sections/Fall-2015.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Fall-2015.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Fall-2015.instructors.csv \
--term-output sections/Fall-2015.terms.csv \
sections/Fall-2015.html sections/Fall-2015.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Fall --year 2016 sections > sections/Fall-2016.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Fall-2016.html.bak > sections/Fall-2016.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Fall-2016.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Fall-2016.instructors.csv \
--term-output sections/Fall-2016.terms.csv \
sections/Fall-2016.html sections/Fall-2016.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Fall --year 2017 sections > sections/Fall-2017.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Fall-2017.html.bak > sections/Fall-2017.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Fall-2017.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Fall-2017.instructors.csv \
--term-output sections/Fall-2017.terms.csv \
sections/Fall-2017.html sections/Fall-2017.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Summer --year 2014 sections > sections/Summer-2014.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Summer-2014.html.bak > sections/Summer-2014.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Summer-2014.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Summer-2014.instructors.csv \
--term-output sections/Summer-2014.terms.csv \
sections/Summer-2014.html sections/Summer-2014.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Summer --year 2015 sections > sections/Summer-2015.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Summer-2015.html.bak > sections/Summer-2015.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Summer-2015.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Summer-2015.instructors.csv \
--term-output sections/Summer-2015.terms.csv \
sections/Summer-2015.html sections/Summer-2015.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Summer --year 2016 sections > sections/Summer-2016.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Summer-2016.html.bak > sections/Summer-2016.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Summer-2016.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Summer-2016.instructors.csv \
--term-output sections/Summer-2016.terms.csv \
sections/Summer-2016.html sections/Summer-2016.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Summer --year 2017 sections > sections/Summer-2017.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Summer-2017.html.bak > sections/Summer-2017.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Summer-2017.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Summer-2017.instructors.csv \
--term-output sections/Summer-2017.terms.csv \
sections/Summer-2017.html sections/Summer-2017.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Summer --year 2018 sections > sections/Summer-2018.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Summer-2018.html.bak > sections/Summer-2018.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Summer-2018.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Summer-2018.instructors.csv \
--term-output sections/Summer-2018.terms.csv \
sections/Summer-2018.html sections/Summer-2018.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Spring --year 2014 sections > sections/Spring-2014.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Spring-2014.html.bak > sections/Spring-2014.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Spring-2014.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Spring-2014.instructors.csv \
--term-output sections/Spring-2014.terms.csv \
sections/Spring-2014.html sections/Spring-2014.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Spring --year 2015 sections > sections/Spring-2015.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Spring-2015.html.bak > sections/Spring-2015.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Spring-2015.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Spring-2015.instructors.csv \
--term-output sections/Spring-2015.terms.csv \
sections/Spring-2015.html sections/Spring-2015.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Spring --year 2016 sections > sections/Spring-2016.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Spring-2016.html.bak > sections/Spring-2016.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Spring-2016.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Spring-2016.instructors.csv \
--term-output sections/Spring-2016.terms.csv \
sections/Spring-2016.html sections/Spring-2016.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Spring --year 2017 sections > sections/Spring-2017.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Spring-2017.html.bak > sections/Spring-2017.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Spring-2017.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Spring-2017.instructors.csv \
--term-output sections/Spring-2017.terms.csv \
sections/Spring-2017.html sections/Spring-2017.csv
# keep original because we'll be changing it in a second
python -m gradeforge download --season Spring --year 2018 sections > sections/Spring-2018.html.bak
# 1. change two opening tags to single closed tag
# 2. the school seems to think <p> is the same as <br>
sed 's#<b>\(.*\)<b>#<b>\1</b>#; s/ <p>$//' sections/Spring-2018.html.bak > sections/Spring-2018.html
# required for Summer 2016, others *might* work but less effort this way
# note that tidy returns 1 on warnings, and the html always gives warnings
tidy -modify -f /dev/null sections/Spring-2018.html || if [ $? -ne 1 ]; then exit $?; fi
python -m gradeforge parse sections --instructor-output sections/Spring-2018.instructors.csv \
--term-output sections/Spring-2018.terms.csv \
sections/Spring-2018.html sections/Spring-2018.csv
python -m gradeforge combine terms sections/Fall-2013.terms.csv sections/Fall-2014.terms.csv sections/Fall-2015.terms.csv sections/Fall-2016.terms.csv sections/Fall-2017.terms.csv sections/Summer-2014.terms.csv sections/Summer-2015.terms.csv sections/Summer-2016.terms.csv sections/Summer-2017.terms.csv sections/Summer-2018.terms.csv sections/Spring-2014.terms.csv sections/Spring-2015.terms.csv sections/Spring-2016.terms.csv sections/Spring-2017.terms.csv sections/Spring-2018.terms.csv > terms.csv
head -1 sections/Fall-2013.csv > sections.csv # headers
for exam in sections/Fall-2013.csv sections/Fall-2014.csv sections/Fall-2015.csv sections/Fall-2016.csv sections/Fall-2017.csv sections/Summer-2014.csv sections/Summer-2015.csv sections/Summer-2016.csv sections/Summer-2017.csv sections/Summer-2018.csv sections/Spring-2014.csv sections/Spring-2015.csv sections/Spring-2016.csv sections/Spring-2017.csv sections/Spring-2018.csv; do tail -n+2 $exam >> sections.csv; done
python -m gradeforge combine instructors sections/Fall-2013.instructors.csv sections/Fall-2014.instructors.csv sections/Fall-2015.instructors.csv sections/Fall-2016.instructors.csv sections/Fall-2017.instructors.csv sections/Summer-2014.instructors.csv sections/Summer-2015.instructors.csv sections/Summer-2016.instructors.csv sections/Summer-2017.instructors.csv sections/Summer-2018.instructors.csv sections/Spring-2014.instructors.csv sections/Spring-2015.instructors.csv sections/Spring-2016.instructors.csv sections/Spring-2017.instructors.csv sections/Spring-2018.instructors.csv > instructors.csv
python -m gradeforge combine departments catalog.departments.csv > departments.csv
rm -f classes.sql
python -m gradeforge sql create
@jyn514
Copy link
Author

jyn514 commented Jun 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment