Created
March 7, 2014 18:58
-
-
Save Equinox-/9417540 to your computer and use it in GitHub Desktop.
Grabs cards from brainspace and exports them as CSV.
This file contains hidden or 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
function grabCard() { | |
if (document.getElementsByClassName("q-title")[0] == undefined) { | |
return; | |
} | |
var data = ""; | |
var prompt = ""; | |
if (document.getElementsByClassName("card-question-prompt")[0] != undefined) { | |
prompt = "<span>" + document.getElementsByClassName("card-question-prompt")[0].innerHTML.replace(/\"/g,"'").replace(/\n/g,"") + "</span></br>"; | |
} | |
data += "\"" + prompt + document.getElementsByClassName("q-title")[0].innerHTML.replace(/\"/g,"'").replace(/\n/g,"") + "\",\"" + document.getElementsByClassName("a-title")[0].innerHTML.replace(/\"/g, "'").replace(/\n/g,"") + "\""; | |
if (window.output == undefined) { | |
window.output=""; | |
window.last=""; | |
window.fieldout = document.createElement("textarea"); | |
document.body.appendChild(window.fieldout); | |
} | |
if (window.last == data || window.last.indexOf(data) != -1) { | |
return; | |
} | |
window.last = data; | |
window.output+=data + "\n"; | |
window.fieldout.innerHTML = output; | |
console.log(data); | |
BSC.Study.flipMainCard(); | |
$(document).ajaxStop(grabCard); | |
grabCard(); | |
BSC.Study.setConfidence(3); | |
} | |
grabCard(); | |
$(document).ajaxStop(grabCard); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment