-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Northeastern University 馃帀馃帀馃帀馃帀馃帀 (#1041)
* Adding support for northeastern: initial commit * Removed neu textbooks parser for now. Will add back in future * Updated courses.py * Added Northeastern to schools.jsx * Fixed a comment * Fixed linting erors * Updated the regex * Updated the regex in schools.jsx * Removed unneeded code from neu/courses.py * Changed hardcoded term for Spring 2018 * Added the jhu files back * Tweaked the indentation in courses.py and fixed a bug in main.js
- Loading branch information
1 parent
ab995ae
commit 4c2439d
Showing
10 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,4 @@ venv/ | |
.vscode/ | ||
webpack-stats.json | ||
workfile.html | ||
cache |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
chapman | ||
neu | ||
gw | ||
jhu | ||
queens | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (C) 2017 Semester.ly Technologies, LLC | ||
# | ||
# Semester.ly is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Semester.ly is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
from parsing.schools import load_school_logger | ||
load_school_logger('neu') |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"school": { | ||
"code": "neu", | ||
"name": "Northeastern University" | ||
}, | ||
"course_code_regex": "([A-Z]{0,4} [0-9]{4})$", | ||
"terms": [ | ||
"Spring" | ||
], | ||
"granularity": 5, | ||
"ampm": true, | ||
"full_academic_year_registration": false, | ||
"single_access": true, | ||
"active_semesters": { | ||
"2018": [ | ||
"Spring" | ||
] | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (C) 2017 Semester.ly Technologies, LLC | ||
# | ||
# Semester.ly is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Semester.ly is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
import re | ||
import sys | ||
import os | ||
import subprocess | ||
|
||
from parsing.library.base_parser import BaseParser | ||
|
||
class Parser(BaseParser): | ||
|
||
def __init__(self, **kwargs): | ||
"""Construct NEU parser object. | ||
Args: | ||
**kwargs: pass-through | ||
""" | ||
super(Parser, self).__init__('neu', **kwargs) | ||
|
||
# Required to prevent the python code from writing courses.json. | ||
# The JS script saves the courses.json when using search neu scrapers. | ||
def end(self): | ||
pass | ||
|
||
def start(self, **kwargs): | ||
|
||
path = os.path.join(os.path.dirname(__file__), 'main.js') | ||
subprocess.call(['node', '--max_old_space_size=8192', path]) | ||
print("done scraping neu") | ||
|
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require('babel-core/register'); | ||
require('babel-polyfill'); | ||
const searchneu = require('searchneu'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
searchneu.default.main(true).then((retVal) => { | ||
const semesterlyString = JSON.stringify(retVal, null, 4); | ||
fs.writeFile(path.join(__dirname, 'data', 'courses.json'), semesterlyString, (err) => { | ||
if (err) { | ||
global.console.log(err); | ||
return; | ||
} | ||
|
||
global.console.log('saved semesterly data'); | ||
}); | ||
}).catch((err) => { | ||
global.console.log(err); | ||
}); |
This file contains 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