glavin001 / self-service Goto Github PK
View Code? Open in Web Editor NEWNode.js API for Saint Mary's University Self-Service Banner.
License: MIT License
Node.js API for Saint Mary's University Self-Service Banner.
License: MIT License
Used to pass into request for public class schedule by subject (see #7).
Request URL:https://ssb-nlive.smu.ca/pls/sNLIVE/bwckgens.p_proc_term_date
Request Method:POST
Referer:https://ssb-nlive.smu.ca/pls/sNLIVE/bwckschd.p_disp_dyn_sched
Form Data: p_calling_proc=bwckschd.p_disp_dyn_sched&p_term=201510&p_by_date=Y&p_from_date=&p_to_date=
p_calling_proc:bwckschd.p_disp_dyn_sched
p_term:201510
p_by_date:Y
p_from_date:
p_to_date:
getSubjects
See self.getCourse
, lines 84+.
response.statusCode
= 404
crn: 23978
Done loading.
Fri, 10 Jan 2014 08:09:23 GMT
Failed to execute target procedure ORA-00001: unique constraint (WTAILOR.PK_TWGRWPRM) violated
ORA-06512: at "WTAILOR.TWBKWBIS", line 6805
ORA-06512: at "BANINST1.BWSKFSHD", line 503
ORA-06512: at line 33
DAD name: sNLIVE
PROCEDURE : bwskfshd.P_CrseSchdDetl
URL : http://ssb-nlive.smu.ca:443/pls/sNLIVE/bwskfshd.P_CrseSchdDetl?term_in=201420&crn=23978
PARAMETERS :
===========
term_in:
201420
crn:
23978
ENVIRONMENT:
============
PLSQL_GATEWAY=WebDb
GATEWAY_IVERSION=2
SERVER_SOFTWARE=Oracle-Application-Server-11g
GATEWAY_INTERFACE=CGI/1.1
SERVER_PORT=443
SERVER_NAME=ssb-nlive.smu.ca
REQUEST_METHOD=GET
QUERY_STRING=term_in=201420&crn=23978
PATH_INFO=/bwskfshd.P_CrseSchdDetl
SCRIPT_NAME=/pls/sNLIVE
REMOTE_HOST=
REMOTE_ADDR=24.222.193.222
SERVER_PROTOCOL=HTTP/1.1
REQUEST_PROTOCOL=HTTPS
REMOTE_USER=www2_user
ORACLE_SSO_USER=
OSSO_IDLE_TIMEOUT_EXCEEDED=
OSSO_USER_GUID=
HTTP_CONTENT_LENGTH=
HTTP_CONTENT_TYPE=
HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
HTTP_HOST=ssb-nlive.smu.ca
HTTP_ACCEPT=
HTTP_ACCEPT_ENCODING=
HTTP_ACCEPT_LANGUAGE=
HTTP_ACCEPT_CHARSET=
HTTP_COOKIE==; SESSID=UEtBMjRNMzU4MzU2
HTTP_IF_MODIFIED_SINCE=
HTTP_REFERER=https://ssb-nlive.smu.ca/pls/sNLIVE/bwskfshd.P_CrseSchd
HTTP_SOAPACTION=
HTTP_ORACLE_ECID=
HTTP_ORACLE_CACHE_VERSION=
HTTP_AUTHORIZATION=
WEB_AUTHENT_PREFIX=
DAD_NAME=sNLIVE
DOC_ACCESS_PATH=docs
DOCUMENT_TABLE=wpg_document
PATH_ALIAS=
REQUEST_CHARSET=AL32UTF8
REQUEST_IANA_CHARSET=UTF-8
SCRIPT_PREFIX=/pls
HTTP_IF_MATCH=
HTTP_CACHE_CONTROL=
SOAP_BODY=
HTTP_X_ORACLE_DEVICE_CLASS=
HTTP_X_ORACLE_DEVICE_ORIENTATION=
HTTP_X_ORACLE_DEVICE_MAXDOCSIZE=
HTTP_X_ORACLE_DEVICE=
HTTP_X_ORACLE_ORIG_ACCEPT=
HTTP_X_ORACLE_ORIG_USER_AGENT=
HTTP_X_ORACLE_USER_LOCALE=
HTTP_X_ORACLE_USER_NAME=
HTTP_X_ORACLE_USER_DISPLAYNAME=
HTTP_X_ORACLE_USER_USERKIND=
HTTP_X_ORACLE_USER_AUTHKIND=
HTTP_X_ORACLE_USER_DEVICEID=
HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE1=
HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE2=
HTTP_X_ORACLE_USER_LOCATION_ADDRESSLASTLINE=
HTTP_X_ORACLE_USER_LOCATION_BLOCK=
HTTP_X_ORACLE_USER_LOCATION_CITY=
HTTP_X_ORACLE_USER_LOCATION_COMPANYNAME=
HTTP_X_ORACLE_USER_LOCATION_COUNTY=
HTTP_X_ORACLE_USER_LOCATION_STATE=
HTTP_X_ORACLE_USER_LOCATION_POSTALCODE=
HTTP_X_ORACLE_USER_LOCATION_POSTALCODEEXT=
HTTP_X_ORACLE_USER_LOCATION_COUNTRY=
HTTP_X_ORACLE_USER_LOCATION_TYPE=
HTTP_X_ORACLE_USER_LOCATION_X=
HTTP_X_ORACLE_USER_LOCATION_Y=
HTTP_X_ORACLE_SERVICE_HOME_URL=
HTTP_X_ORACLE_SERVICE_PARENT_URL=
HTTP_X_ORACLE_HOME_URL=
HTTP_X_ORACLE_MODULE_CALLBACK_URL=
HTTP_X_ORACLE_MODULE_CALLBACK_LABEL=
HTTP_X_ORACLE_CACHE_USER=
HTTP_X_ORACLE_CACHE_SUBID=
HTTP_X_ORACLE_CACHE_AUTH=
HTTP_X_ORACLE_CACHE_DEVICE=
HTTP_X_ORACLE_CACHE_LANG=
HTTP_X_ORACLE_CACHE_ENCRYPT=
HTTP_X_ORACLE_ASSERT_USER=
null
null
null
Resulting in the following course object:
{ title: '',
crn: '23978',
type: '',
time: { start: '', end: undefined },
days: [],
location: '',
startDate: Invalid Date,
endDate: Invalid Date,
scheduleType: '',
instructors: '' },
Unit Tests are already available. Of course, I do not want to include someone's actual login credentials, so instead, we can disable the authenticated requests for Travis CI. There may be another secure way around this in the future.
/cc @valencik
SMU just updated Banner. Lame. Let's hope it doesn't break anything.
See #7.
Extract the term
value from the href
of the a
: https://ssb-nlive.smu.ca/pls/sNLIVE/bwckschd.p_disp_detail_sched?term_in=201510&crn_in=12715
For Writing Help Online - 12521 - WHO 1000 - 1A
it errors:
TypeError: Cannot read property '1' of null
at Request._callback (/Users/glavin/Documents/Project Dev/UniCal/node_modules/self-service-banner/lib/getCoursesSchedule.js:147:23)
at Request.self.callback (/Users/glavin/Documents/Project Dev/UniCal/node_modules/self-service-banner/node_modules/request/request.js:123:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/Users/glavin/Documents/Project Dev/UniCal/node_modules/self-service-banner/node_modules/request/request.js:893:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/Users/glavin/Documents/Project Dev/UniCal/node_modules/self-service-banner/node_modules/request/request.js:844:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
Changing the regex solves the problem.
Before: /(.*) - ([0-9]*) - (.{4}) ([0-9]{4}) - (.*)/
After: /(.*) - ([0-9]*) - (.*) ([0-9]{4}) - (.*)/
Used to pass into #12.
Request URL:https://ssb-nlive.smu.ca/pls/sNLIVE/bwckschd.p_disp_dyn_sched
Request Method:GET
Referer:https://ssb-nlive.smu.ca/pls/sNLIVE/twbkwbis.P_GenMenu?name=homepage
getTerms
With the release of the SMUapp there is a REST API available.
{
"versions": {
"ios": ["2.0.0"],
"android": ["2.0.0"]
},
"layout": {
"defaultMenuIcon": "true",
"primaryColor": "6e0408",
"headerTextColor": "ffffff",
"accentColor": "5c96ae",
"menuIconUrl": "https://mobile.elluciancloud.com/mobilecloud/images/icon-menu-iphone-retina.png",
"subheaderTextColor": "ffffff",
"homeUrlPhone": "https://smu-mobile.smu.ca:8443/images/bg04_1024x1024.png",
"homeUrlTablet": "https://smu-mobile.smu.ca:8443/images/bg04_2048x2048.png",
"schoolLogoPhone": "https://smu-mobile.smu.ca:8443/images/smu_school_logo.png"
},
"about": {
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"phone": {
"number": "(902) 420-5400"
},
"email": {
"address": "[email protected]"
},
"website": {
"url": "http://www.smu.ca"
},
"privacy": {
"url": "http://www.smu.ca/administration/foipop/",
"display": "SMU Privacy Policy"
},
"contact": "923 Robie Street\nHalifax, Nova Scotia\nCanada B3H 3C3\nhttp://www.smu.ca/contact-01.html",
"logoUrlPhone": "https://smu-mobile.smu.ca:8443/images/smu_about_logo.png",
"version": {
"url": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/version"
}
},
"mapp": {
"mapp1391106667424": {
"type": "courses",
"visible": "faculty",
"name": "Courses",
"order": "1",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"overview": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/courses/overview",
"full": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/courses/fullview",
"daily": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/courses/calendarview",
"roster": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/courses/roster",
"grades": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/grades"
}
},
"mapp1391106700362": {
"type": "grades",
"name": "Grades",
"order": "2",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"grades": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/grades"
}
},
"mapp1391106731672": {
"type": "notifications",
"name": "Holds",
"order": "3",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"notifications": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/notifications"
}
},
"mapp1391106759705": {
"type": "header",
"name": "SMU Information",
"order": "4"
},
"mapp1391106790972": {
"type": "numbers",
"name": "SMU Important Numbers",
"order": "5",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"numbers": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/numbers/1503/M/CLOSURECANCELLATIONHOTLINES,GENERAL,OTHER,SECURITY?campusId=M&categoryId=Closure%2FCancellation+Hotlines&categoryId=General&categoryId=Other&categoryId=Security"
}
},
"mapp1391106827359": {
"type": "events",
"name": "SMU Events",
"order": "6",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"events": "https://smu-mobile.smu.ca:8443/banner-mobileserver/rest/events?namekeys=event1391091726749"
}
},
"mapp1391106892806": {
"type": "feed",
"name": "SMU News",
"order": "7",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"feed": "https://smu-mobile.smu.ca:8443/banner-mobileserver/rest/1.2/feed?namekeys=feed1391091752555"
}
},
"mapp1391106922357": {
"type": "maps",
"name": "SMU Maps",
"order": "8",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"buildings": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/building/1503",
"campuses": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/campus/1503/M"
}
},
"mapp1391106953657": {
"type": "web",
"name": "SMUport",
"order": "10",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "https://smuport.smu.ca"
}
},
"mapp1391106976960": {
"type": "web",
"name": "Academics",
"order": "11",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "http://smu.ca/academics/welcome.html"
}
},
"mapp1391107000904": {
"type": "web",
"name": "SMU People Finder",
"order": "9",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "http://www.smu.ca/search_frame.html"
},
"external": "true"
},
"mapp1391107988768": {
"type": "web",
"name": "Residences & Housing",
"order": "15",
"urls": {
"url": "http://www.smu.ca/campus-life/residences-and-housing.html"
},
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]"
},
"mapp1391108086484": {
"type": "web",
"name": "Athletics",
"order": "12",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "http://www.smu.ca/campus-life/athletics-and-recreation.html"
}
},
"mapp1391108146729": {
"type": "web",
"name": "SMUSA",
"order": "17",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "http://smusa.ca/"
}
},
"mapp1391108220272": {
"type": "web",
"name": "Security",
"order": "16",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/icon-signout_40.png",
"urls": {
"url": "http://www.smu.ca/campus-life/contact-security.html"
}
},
"mapp1391108267253": {
"type": "web",
"name": "The Counselling Centre",
"order": "13",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "http://www.smu.ca/campus-life/the-counselling-centre.html"
}
},
"mapp1392731580538": {
"type": "web",
"name": "Library",
"order": "14",
"icon": "https://mobile.elluciancloud.com/mobilecloud/images/mobile-icon-images/[email protected]",
"urls": {
"url": "http://www.smu.ca/academics/the-patrick-power-library.html"
}
}
},
"analytics": {
"client": null,
"ellucian": "UA-42037363-1"
},
"security": {
"url": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/security/getUserInfo"
},
"map": {
"campuses": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/campus/1503",
"buildings": "https://smu-mobile.smu.ca:8443/banner-mobileserver/api/2.0/building/1503"
}
}
Course of type Recitation does not load correctly.
Change callback return API from (error, response, data)
to (error, data, response)
.
We should care more about the data
than the response. The response is messy. The whole point of this library is to handle the response parsing!
sel_subj
ACCT
.Remote Address:140.184.253.61:443
Request URL:https://ssb-nlive.smu.ca/pls/sNLIVE/bwckschd.p_get_crse_unsec
Request Method:POST
Host:ssb-nlive.smu.ca
Origin:https://ssb-nlive.smu.ca
Referer:https://ssb-nlive.smu.ca/pls/sNLIVE/bwckgens.p_proc_term_date
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36
Form Data:
term_in:201510
sel_subj:dummy
sel_day:dummy
sel_schd:dummy
sel_insm:dummy
sel_camp:dummy
sel_levl:dummy
sel_sess:dummy
sel_instr:dummy
sel_ptrm:dummy
sel_attr:dummy
sel_subj:ACCT
sel_crse:
sel_title:
sel_insm:%
sel_from_cred:
sel_to_cred:
sel_levl:%
sel_instr:%
sel_attr:%
begin_hh:0
begin_mi:0
begin_ap:a
end_hh:0
end_mi:0
end_ap:a
getClassScheduleListingForSubject(subject)
getCoursesSchedule
login
weekAtAGlance
getCourse
helpers
such as getJsonFromUrl
Update Docs to use quotes in JSON object for usage.
@DylanYoung found this bug.
Request URL:https://ssb-nlive.smu.ca/pls/sNLIVE/bwskotrn.P_ViewTran
Request Method:POST
Host:ssb-nlive.smu.ca
Origin:https://ssb-nlive.smu.ca
Referer:https://ssb-nlive.smu.ca/pls/sNLIVE/bwskotrn.P_ViewTermTran
Form Data:
levl:
tprt:ADVS
Login authentication should return error in callback when incorrect.
Current is will not notify the user that the login failed.
Selector: :content("unofficial evaluation")~ .datadisplaytable
Target URL: https://ssb-nlive.smu.ca/pls/sNLIVE/bwckcapp.P_VerifyDispEvalViewOption
Method type: POST
Referer: https://ssb-nlive.smu.ca/pls/sNLIVE/bwcksmds.p_whatif_submit
Form data:
request_no:2
program_summary:3
Note: this has to be called AFTER the requirements have been evaluated.
Create Node.js Package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.