diff --git a/api.js b/api.js index 0de1cc2..0729fe7 100644 --- a/api.js +++ b/api.js @@ -32,17 +32,28 @@ module.exports = { }); }, logout: (next) => { + // gets URL first request.get(sources.sis.logout, () =>{ request({ uri: sources.sis.logout, method: "GET" }, (err, res, body) => { if (!err && res.statusCode == 200) { - var msg = $('meta',body).attr('content'); - next(null, res.headers['set-cookie'], msg.slice( - msg.indexOf('Welcome,+')+9, - msg.indexOf('+to+the+Rensselear')-1 - )); + next(null); + } else { + next(err); + } + }); + }); + }, + get_student_menu: (next) => { + request.get(sources.sis.get_student_menu, () =>{ + request({ + uri: sources.sis.get_student_menu, + method: "GET", + }, (err, res, body) => { + if (!err && res.statusCode == 200) { + next(null); } else { next(err); } diff --git a/sources.json b/sources.json index 358ffd3..ad53e1d 100644 --- a/sources.json +++ b/sources.json @@ -3,7 +3,7 @@ "login": "https://sis.rpi.edu/rss/twbkwbis.P_ValLogin", "logout": "https://sis.rpi.edu/rss/twbkwbis.P_Logout", "classes": "https://sis.rpi.edu/rss/bwskfreg.P_AltPin", - "student_menu": "https://sis.rpi.edu/rss/twbkwbis.P_GenMenu" + "get_student_menu": "https://sis.rpi.edu/rss/twbkwbis.P_GenMenu?name=bmenu.P_StuMainMnu" }, "yacs": { "departments": "https://yacs.cs.rpi.edu/api/v5/schools.json?show_departments=true"