Last active
April 22, 2025 02:06
-
-
Save masonhorder/1cf46b72afd006859e957883f8ff6833 to your computer and use it in GitHub Desktop.
infinite campus hack
This file contains hidden or 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
// directions: | |
// open infinite campus on computer website | |
// login | |
// command option i (open command tools) | |
// go to console | |
// paste this code | |
async function main () { | |
const classes = await fetch( | |
'/campus/resources/portal/roster?_enableScheduleForGrades=true', { | |
headers: { | |
'Accept': 'application/json, text/plain, */*', | |
'Cache-Control': 'no-cache' | |
} | |
}) | |
.then(r => r.json()) | |
.then(arr => arr.map(({ | |
sectionID, | |
courseName, | |
teacherDisplay | |
}) => ({ | |
sectionID, | |
course: courseName, | |
teacher: teacherDisplay | |
}))) | |
for (const period of classes) { | |
const { | |
periods: [{ name }], | |
terms: [{ termName: term1 }, { termName: term2 = '' } = {}] | |
} = await fetch( | |
`/campus/resources/portal/section/${period.sectionID}?_expand=course-school&_expand=terms&_expand=periods-periodSchedule&_expand=teacherPreference&_expand=room&_expand=teachers`, { | |
headers: { | |
'Accept': 'application/json, text/plain, */*', | |
'Cache-Control': 'no-cache' | |
} | |
}) | |
.then(r => r.json()) | |
delete period.sectionID | |
period.period = name | |
const semesters = term1 + term2 | |
period.semester = semesters === 'S1S2' ? ' ' : semesters | |
} | |
return classes | |
.sort((a, b) => +a.period - +b.period || | |
+a.semester[1] - +b.semester[1]) | |
.map(({ period, semester, course, teacher }) => `Period ${period}: ${course}(${teacher})`) | |
.join('\n') || | |
'Not cuurently enrolled in any classes' | |
} | |
main() | |
.then(output => { | |
alert(output) | |
}) | |
// modified code from: https://github.com/SheepTester/hello-world/blob/master/ic-get-schedule.js |
fr
please tell me how you use this
"// directions:
// open infinite campus on computer website
// login
// command option i (open command tools)
// go to console
// paste this code"
do this actully work
after running the code, it shows me my teachers names and period
i pasted the code now what?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
please tell me how you use this