Código para abrir todas as páginas das gravações
Você deve estar na página onde fica a lista de gravações
JavaScript
javascript:
var topic = prompt('Insira o número do tópico onde esta a lista de link das GRAVAÇÕES: Tópico ');
var segundos = prompt('Defina o tempo de intervalo (SEGUNDOS) entre as aberturas de página: ');
if (segundos === '') {
segundos = 5
}
var pai = document.getElementById("section-" + topic).getElementsByClassName('content')[0].getElementsByTagName('ul')[0];
var i = 0;
var gravacoes = 0;
function create(htmlStr) {
var frag = document.createDocumentFragment(),
temp = document.createElement('div');
temp.innerHTML = htmlStr;
while (temp.firstChild) {
frag.appendChild(temp.firstChild);
}
return frag;
}
function fun() {
if((pai.children[i].tagName == "LI") && (pai.children[i].className == "activity url modtype_url ")){
url = 'http://forceclass-01.linuxforce.com.br/mod/url/view.php?id=' + pai.children[i].id.split('-')[1];
console.log(url);
var fragment = create('<a href="' + url + '" id="mlink-' + i + '" target="_blank" style="display:none">link ' + i + '</a>');
document.body.insertBefore(fragment, document.body.childNodes[0]);
document.getElementById("mlink-" + i).click();
gravacoes++;
}
i++;
if (i < pai.children.length) {
myLoop();
} else {
alert('Pronto! Foram abertas ' + gravacoes + ' páginas de gravações');
}
};
function myLoop () {
setTimeout(function () {
fun();
}, (segundos * 1000))
};
fun();
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.