//////////Grab archived urls
var archived = document.getElementsByClassName("link-button primary"); var archivedUrls = []; var slugs = []; for (var i = 0; i < archived.length; i++){ archivedUrls.push(document.getElementsByClassName("link-button primary")[i].href); } //////////////////////////////
function getDatas(LLL){
$.ajax({
url: LLL,
dataType: 'text',
success: function (data) {
var re = /F[a-zA-Z0-9-]*-0\d{2}/;
var info = data.match(re)[0];
var fixeInfo = info.substring(1);
slugs.push(fixeInfo);
console.log(fixeInfo);
}
});
}
var ii = 0; // set your counter to 1function myLoop () { // create a loop function setTimeout(function () { // call a 3s setTimeout when the loop is called console.log(archivedUrls[ii]); getDatas(archivedUrls[ii]); ii++; // increment the counter if (ii < archivedUrls.length) { // if the counter < 10, call the loop function myLoop(); // .. again which will trigger another } else { console.log('Type "slugs" to view all slugs gathered'); } }, 1000) }
myLoop(); // start the loop
audio-002 eefun-001 experiments-001 hci model-thinking-006 recsys-001
I will work on figuring out the slugs next. For you now, you will need to signup for the course and figure it out. You can also find the same the list on Class Central where you can filter by subjects or sort by rating: https://www.class-central.com/collection/coursera-old-stack