forked from andyjjrt/NCCUCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstant.py
43 lines (29 loc) · 922 Bytes
/
constant.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
33
34
35
36
37
38
39
40
41
42
43
import os
from dotenv import load_dotenv
load_dotenv()
YEAR = os.getenv("YEAR") or ""
SEM = os.getenv("SEM") or ""
USERNAME = os.getenv("USERNAME") or ""
PASSWORD = os.getenv("PASSWORD") or ""
SERVER_URL = "http://es.nccu.edu.tw/"
KEY = "angu1arjjlST@2019"
SEM_API = SERVER_URL + "semester/"
PERSON_API = SERVER_URL + "person/"
COURSE_API = SERVER_URL + "course/"
TRACE_API = SERVER_URL + "tracing/"
def url(id, year_sem=YEAR + SEM):
return (
"http://newdoc.nccu.edu.tw/teaschm/"
+ year_sem
+ "/statistic.jsp-tnum="
+ id
+ ".htm"
)
def course_rate_url(param, year_sem=YEAR + SEM):
return "http://newdoc.nccu.edu.tw/teaschm/" + year_sem + "/" + param
YEAR_SEM = YEAR + SEM
def rate_qry():
return str(os.getenv("RATE_QRY")).split(",")
COURSERESULT_YEARSEM = ["1102", "1111", "1112", "1121"]
def courseresult_csv(sem):
return sem + "CourseResult.csv"