forked from mhewedy/SBO-video-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
25 lines (20 loc) · 750 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var sboModule = sboModule || {};
(function () {
let startNew = function () {
let techbusBaseUrl = 'https://techbus.safaribooksonline.com/';
let courseId = window.location.pathname.match('/([0-9]+)/?')[1];
$.get(techbusBaseUrl + courseId).always(function (html) {
sboModule.crawlerService.crawl($('.tab-group-content ol > li').children('div.content-ContentSummary').parent(), html);
});
};
let startTechbus = function () {
setTimeout(function () {
sboModule.crawlerService.crawl($('a[data-clip-ref]'));
}, 5000);
};
if (window.location.hostname.indexOf('learning.oreilly.com') >= 0) {
startNew();
} else {
startTechbus();
}
})();