diff options
Diffstat (limited to 'lib/login.js')
-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); } |