Skip to content

Commit 668755b

Browse files
committed
Add searchTerm query param to some requests
1 parent 27c3d2a commit 668755b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/scrapers/sis_api.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ async def get_term_instructors(
9494
return data
9595

9696

97-
async def get_all_attributes(session: aiohttp.ClientSession) -> list[dict[str, str]]:
97+
async def get_all_attributes(
98+
session: aiohttp.ClientSession, search_term: str = ""
99+
) -> list[dict[str, str]]:
98100
"""
99101
Fetches the master list of attributes from SIS.
100102
@@ -108,7 +110,7 @@ async def get_all_attributes(session: aiohttp.ClientSession) -> list[dict[str, s
108110
]
109111
"""
110112
url = "https://sis9.rpi.edu/StudentRegistrationSsb/ssb/classSearch/get_attribute"
111-
params = {"offset": 1, "max": 2147483647}
113+
params = {"searchTerm": search_term, "offset": 1, "max": 2147483647}
112114
async with session.get(url, params=params) as response:
113115
response.raise_for_status()
114116
raw_data = await response.text()
@@ -117,7 +119,9 @@ async def get_all_attributes(session: aiohttp.ClientSession) -> list[dict[str, s
117119
return data
118120

119121

120-
async def get_all_colleges(session: aiohttp.ClientSession) -> list[dict[str, str]]:
122+
async def get_all_colleges(
123+
session: aiohttp.ClientSession, search_term: str = ""
124+
) -> list[dict[str, str]]:
121125
"""
122126
Fetches the master list of colleges (schools) and codes from SIS.
123127
@@ -131,7 +135,7 @@ async def get_all_colleges(session: aiohttp.ClientSession) -> list[dict[str, str
131135
]
132136
"""
133137
url = "https://sis9.rpi.edu/StudentRegistrationSsb/ssb/classSearch/get_college"
134-
params = {"offset": 1, "max": 2147483647}
138+
params = {"searchTerm": search_term, "offset": 1, "max": 2147483647}
135139
async with session.get(url, params=params) as response:
136140
response.raise_for_status()
137141
raw_data = await response.text()

0 commit comments

Comments
 (0)