diff options
author | przemyslawpluta <przemekpluta@hotmail.com> | 2014-10-01 19:41:39 +0100 |
---|---|---|
committer | przemyslawpluta <przemekpluta@hotmail.com> | 2014-10-01 19:41:39 +0100 |
commit | 4f661004d55e58df3eee5ecba83d94019b0573e1 (patch) | |
tree | 3d7046a93e3325223bb2adfc05602c52077905b9 | |
parent | cdba20bbd85f1f9167762eac6345679f07375671 (diff) | |
download | mongo-edu-4f661004d55e58df3eee5ecba83d94019b0573e1.zip |
new website support
-rw-r--r-- | lib/courseware.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/courseware.js b/lib/courseware.js index 82a1e1b..0c47210 100644 --- a/lib/courseware.js +++ b/lib/courseware.js @@ -12,6 +12,7 @@ var fs = require('fs'), ProgressBar = require('progress'), inquirer = require('inquirer'), colors = require('colors'), + util = require('util'), _ = require('lodash'); var isWin = /^win/.test(process.platform), @@ -46,7 +47,7 @@ function listVideos(url, jar, id, callback) { if (res.statusCode === 200) { var $ = cheerio.load(body), - pageView = $('section.course-content').html(), + pageView = $('div.col-sm-9.course-content section').html(), getVideoIds = (pageView) ? pageView.match(/(.0:)(.*?)(&)/g) : pageView; getVideoIds = (!getVideoIds) ? [] : getVideoIds.map(function map(item) { return { id: id, video: 'https://youtu.be/' + item.replace('.0:','').replace('&','')}; }); @@ -93,11 +94,11 @@ module.exports = { 'use strict'; - var chapter = $('.chapter'), master = $('div.inner-wrapper h1').text(), courses = []; + var chapter = $('.accordion-caret'), master = $('h1').text(), courses = []; $(chapter).each(function each(i, item) { var current = $(item), - title = current.find('h3 a').text(), + title = current.find('a.accordion-toggle').text(), list = current.find('ul'), stack = []; |