Need private packages and team management tools?Check out npm Teams »

mtu-courses

0.1.2 • Public • Published

🏛 mtu-courses

Scrape all courses for a given semester from Michigan Tech's website.

Install

npm i mtu-courses

Quickstart

const Courses = require('mtu-courses');
 
(async () => {
  const mtu = new Courses();
 
  await mtu.load();
 
  // Get all meeting dates for first loaded course
  console.log(mtu.courses.find(course => course.startDate !== undefined).getMeetingDates());
 
  const totalFee = mtu.courses.filter(course => course.online).reduce((accum, course) => accum + course.fee, 0);
 
  console.log(`It would cost an extra $${totalFee / 100} to take all offered online courses this semester.`);
})();

(Note that the Michigan Tech website/database system is quite slow and it takes around 13-15 seconds for await mtu.load() to complete.)

All dates/times are in UTC.

Fees are in cents instead of dollars to be consistent with the way financal data is usually handled in code.

📚 Docs

Hosted on Github Pages.

Install

npm i mtu-courses

DownloadsWeekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

15.1 kB

Total Files

11

Last publish

Collaborators

  • avatar