Skip to content

johnrapp/novasoftware-schedule-parser

Repository files navigation

Novasoftware Schedule Parser

This project hosts the paper and implementation code for my final High School Essay (Gymnasiearbete).

Paper

The files for the paper are contained in the paper directory, where the actual paper document may be found as paper.pdf.

The paper is written in LaTeX, with the source code in paper.tex.

Implementation

Installation

The implementation requires Node.js which may be downloaded and installed from the Node.js website.

To install the program, download or git clone this repository.

Next, the necessary dependencies must be installed by navigating to the project root directory and running the following command in the terminal

$ npm install

Usage

To run the program navigate to the project root directory and execute

$ node .

This will download the schedules specified in config.json and placing them schedules directory. The first level in the schedules directory contains the weeks while the next level contains the schedules (e.g the schedule for 13TE week 15 is found at schedules/15/13TE.json).

config.json

The program may be configured using the config.json file. The default config looks as such

{
	"schoolId": 99810,
	"schoolCode": 945537,
	"classes": [
		"13TE",
		"13ESMU"
	],
	"weeks": [
		15, 16
	]
}

The properties of the config object are

  • schoolId - {number} - The school id, found in the URL query string as schoolid
  • schoolCode - {number} - The school code, found in the URL query string as code
  • classes - {[string]|"*"} - The array of class names. If the string "'*"` instead is provided, all classes will be included
  • weeks - {[number]|"*"} - The array of weeks. The string "*" denotes all weeks
  • requestTimeout - {number} - Optional. The timeout between subsequent HTTP requests

If no schoolId or schoolCode is provided, the program will use the id and code of Värmdö Gymnasium.

For example the configuration to fetch all classes and weeks for the default school with no request timeout would be

{
	"classes": "*",
	"weeks": "*",
	"requestTimeout": 0
}
School IDs and codes

The ids and codes of some schools are presented in the table below. The schools are arbitrarily selected and in no particular order. The fourth column indicates whether or not the program has successfully parsed schedules from the school. A check mark provides no guarantee that the parsing process works, while a cross may not necessarily mean that it does not. If the program can not parse a particular schedule, adjustments may have to be made to the source code (you can learn about this in the paper).

School schoolId schoolCode Success
Värmdö Gymnasium 99810 945537
Östra Real 59150 522626
Tyresö Gymnasium 27820 519876
Sundsta-Älvkullegymnasiet 18200 993161
Norra Real 81530 123489
Katedralskolan i Uppsala 68600 12689
Thorildsplans gymnasium 80710 211677

Code

The implementation is written in JavaScript for Node.js.

The PDF parsing logic is contained in parse-lessons.js while the parsing of clicked lessons is performed in parse-clicked-lesson.js. These are the files to which adjustments can be made in order to support other schools or schedules.

All the communication with the Novasoftware server is done through novasoftware.js.

Demo

The same process described in the process and implemented in this project powers the schedule viewing application vgy.rocks/schema for Värmdö Gymnasium. The repository for this application may be found here.

License

GNU General Public License v3.0

About

Novasoftware schedule parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published