Skip to content

Instantly share code, notes, and snippets.

@masonhorder
Last active April 22, 2025 02:06
Show Gist options
  • Save masonhorder/1cf46b72afd006859e957883f8ff6833 to your computer and use it in GitHub Desktop.
Save masonhorder/1cf46b72afd006859e957883f8ff6833 to your computer and use it in GitHub Desktop.
infinite campus hack
// 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
@DeEeZnuysm
Copy link

please tell me how you use this

@haily-ops
Copy link

fr

@hackinghacker1
Copy link

hackinghacker1 commented Apr 13, 2023

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"

@ccanaan
Copy link

ccanaan commented Feb 13, 2024

do this actully work

@snailsnail829
Copy link

after running the code, it shows me my teachers names and period

@carterDcadwell
Copy link

i pasted the code now what?

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