-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
executable file
·32 lines (25 loc) · 969 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
with open("info.txt") as f:
lines = [l for l in f.readlines() if l.strip()][:4]
termmap = {
#"WinterSemester":"01", "WinterQuarter":"02", ## fix this
"SpringSemester":"02", "SpringQuarter":"03",
"SummerSession1":"05", "SummerSpecialSession":"06",
"SummerSession2":"07", "SummerQuarter":"08",
"FallSemester":"09", "FallQuarter":"10"
}
username = lines[0].strip().replace(" ","")
password = lines[1].strip().replace(" ","")
term = lines[2].strip().replace(" ","")
term = term[:4]+termmap[term[4:]]
CRNs = lines[3].strip().split(" ")
courses = [{"termCode":term, "course_number":x} for x in CRNs]
bas_url = "https://my.ucdavis.edu/schedulebuilder/"
# login url
login_url = "https://cas.ucdavis.edu/cas/login?service=https%3A%2F%2Fmy%2Eucdavis%2Eedu%2Fschedulebuilder%2Findex%2Ecfm%3Fsb"
url = bas_url+"index.cfm?termCode="+term+"&helpTour="
data = {
'password': password,
'username': username,
'submit': "LOGIN",
'_eventId': 'submit'
}