crawler-ntust-course

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] [![Downloads][download-badge]][npm-url]

Usage no npm install needed!

<script type="module">
  import crawlerNtustCourse from 'https://cdn.skypack.dev/crawler-ntust-course';
</script>

README

crawler-ntust-course

NPM version Build Status Dependency Status Downloads

Install

npm i -D crawler-ntust-course

Usage

This crawer is implementing the Colorgy Course Crawler Spec.

import Crawler from 'crawler-ntust-course';

// Initialize new crawler
var crawler = new Crawler();
crawler.year = 2015;
crawler.term = 1;
// or
crawler = new Crawler({ year: 2015, term: 1 });

// Start crawling, callbacks are provided by promise pattern
crawler.crawl()
  .then(function (data) { console.log(data); })
  .catch(function (err) { console.error(err); });

// Start crawling and log the progress down
crawler.crawl({ onProgressUpdate: function (progress) { console.log('Progress: ' + progress); } });

// Run a function after new data received
crawler.crawl({ onDataReceived: function (data) { console.dir(data); } });

// Get the crawled data
crawler.getData();

License

MIT © Neson