-
-
Save ooredroxoo/ea62c7b2bdc500e544de to your computer and use it in GitHub Desktop.
Scripts para obter informações para scripts de automação.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//classe dos elementos DIV que contem o vídeo | |
//k-u-P-m | |
//o attribute que precisamos para pegar o id do vídeo | |
//data-id | |
//pegando os vídeos | |
VideoElements = document.getElementsByClassName('k-u-P-m'); | |
for (var i = 0, total = VideoElements.length; i < total; i++) { | |
//pegando o nome do arquivo do attribute aria-label, apenas para nossa identificação | |
//pegando o id do vídeo para inserção no iframe | |
console.log('Nome: '+VideoElements.item(i).children[2].getAttribute('aria-label')+' - id para iframe: '+VideoElements.item(i).getAttribute('data-id')); | |
}; | |
/* | |
//url para download(usuários permitidos) | |
'https://drive.google.com/open?id='[data-id]'+&authuser=1' | |
//montagem do iframe para inserção no BB | |
<div class="embed-responsive embed-responsive-4by3"><iframe width="640" height="480" src="https://drive.google.com/a/brazcubas.edu.br/file/d/"+[data-id]+"/preview" frameborder="0" allowfullscreen=""></iframe></div> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Esta gist na página de listagem de cursos varre os links da página em busca | |
* de links para cursos e extrai o id destes cursos. | |
* | |
**/ | |
(function () { | |
var anchorsFromThePage = document.getElementsByTagName('a'); | |
var ids = []; | |
var patt = /(\/courseMain\?course_id)/g; | |
for (var i = 0, len = anchorsFromThePage.length; i < len; i++) | |
if(patt.test(anchorsFromThePage[i].href)) | |
ids.push(anchorsFromThePage[i].href.replace('https://brazcubas.blackboard.com/webapps/blackboard/execute/courseMain?course_id=','')); | |
console.log(ids); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment