diff options
author | przemyslawpluta <przemekpluta@hotmail.com> | 2015-12-04 12:49:55 +0000 |
---|---|---|
committer | przemyslawpluta <przemekpluta@hotmail.com> | 2015-12-04 12:49:55 +0000 |
commit | dd92735205db17526386a678d42c0d36d381bc22 (patch) | |
tree | 76cd7bb71a21c77d0e428c0162920407ac9f3993 /lib | |
parent | d5e840a8c6b30ef36d5df203041366648fade442 (diff) | |
download | mongo-edu-dd92735205db17526386a678d42c0d36d381bc22.zip |
update
update search based on site changes
version bump
Diffstat (limited to 'lib')
-rw-r--r-- | lib/login.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/login.js b/lib/login.js index fb0e81b..d99f7ea 100644 --- a/lib/login.js +++ b/lib/login.js @@ -106,10 +106,10 @@ module.exports = { if (res.statusCode === 200) { var list = [], $ = cheerio.load(body), - current = $('section.my-courses-courses').children(), - link = $(current).filter('.media').children().find('h3').children(), - noCourses = $('section[class="empty-dashboard-message"]').text(), - findNewCourses = $('section[class="empty-dashboard-message"] a').attr('href'); + current = $('#tab-current'), + link = current.find('div.section-course').children().find('h4').children(), + noCourses = current.find('section.section-courses-empty').text(), + findNewCourses = current.find('div.section-courses-empty-buttons a').attr('href'); bar.tick(); @@ -119,7 +119,9 @@ module.exports = { bar.tick(); - if (noCourses) { currentProfile.noCourses = noCourses.trim().split('\n').map(function items(item) { return item.replace(/ +/g, ' '); }).join('') + ' at ' + url + findNewCourses + '.\n'; } + if (noCourses) { currentProfile.noCourses = noCourses.trim().split('\n').map(function items(item) { + return item.replace(/ +/g, ' '); + }).join('').replace(/ +/g, ' ') + ' at ' + url + findNewCourses + '.\n'; } return callback(null, list, currentProfile); } |