GithubHelp home page GithubHelp logo

benedict-liang / nusmods Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nusmodifications/nusmods

0.0 2.0 0.0 1.6 MB

NUS CORS Module Finder & Timetable Builder (Unofficial)

Home Page: http://nusmods.com

License: MIT License

JavaScript 98.51% PHP 1.49%

nusmods's Introduction

NUSMods - NUS CORS Module Finder & Timetable Builder (Unofficial)

NUSMods helps you find modules which fit your schedule, plan your ideal timetable, then share it with your friends or export it to various formats.

Initial Setup

You will need Node.js and npm, which comes with Node.js.

$ npm install -g grunt
$ npm install
$ grunt coffee:tasks
$ grunt

On Windows, type grunt.cmd instead of grunt.

Watching for Changes

Start grunt to auto-build NUSMods as you work:

$ grunt watch

Grunt has been configured to watch files under src/ and tasks/ and compile / concatenate them whenever they change - you should not edit /css/*.css and /js/*.js directly.

Compiling Changes

If you made some changes but grunt watch was not running, compile them using:

$ grunt dev

This will invoke the coffee, less and concat tasks, which is equivalent to what grunt watch does.

Serving Static Files During Development

If you are not already using some other web server, you can use Grunt's built-in static web server at http://localhost:8000/:

$ grunt server watch

Note: Grunt exits automatically when there are no more tasks to run, so the server task needs to prepended to a long-running task like watch.

Building for Production

To get a complete, minified, production build under dist/:

$ grunt

This invokes grunt's default task, which is equivalent to:

$ grunt download jsify dev clean mkdirs css min denull rev usemin html compress time

Updating Module Information

The download task automatically downloads the latest module information JSON file from http://nusmods.com/json/mod_info.json if it has been updated. It is executed by default when you run grunt's default task.

The file downloaded is identical to that generated by the crawl task. Crawling takes a considerable amount of time, so this lets you jump straight into development.

For development purposes, you should not need to do the crawling yourself unless you are working on the crawler itself.

Crawling Module Information

To do a complete crawl:

$ grunt crawl

The crawl task caches every page retrieved, and compares the Correct as at timestamp to determine if it should retrieve a fresh set of pages.

It also forces a refresh for pages retrieved more than 2 days ago by default, which can be set by the crawl.maxCacheAge property in grunt.js:

crawl: {
  cachePath: 'cache',
  dest: 'json/mod_info.json',
  maxCacheAge: 2 * 86400 // in seconds
}

To manually force a refresh:

$ grunt crawl:refresh

Crawling NUS Bulletin information is disabled by default as it is not used in NUSMods currently, but to crawl with it enabled:

$ grunt crawl:nusBulletin

Note: This will take a long time.

Optional Dependencies

  • PHP for export and URL shortening scripts.
  • YOURLS for URL shortening.
  • wkhtmltopdf and wkhtmltoimage for pdf and image export. Using the static binaries is suggested, as compiling with all the features of the static build needs a custom patched version of QT, which takes a long time to build.

License

Copyright (c) 2012 Eu Beng Hee. Licensed under the MIT license.

nusmods's People

Contributors

benedict-liang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.