Last active
August 29, 2015 14:01
-
-
Save elovelan/4b7b140f91185d27d88f to your computer and use it in GitHub Desktop.
Manilla-downloader
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
(function() { | |
/* Edit if you have a slow connection! */ | |
var delayInSeconds = 2; | |
var csv = ""; | |
function download() { | |
var dataRows, getNext, max, curr = 0, nextPage; | |
nextPage = $("a.next_page"); | |
dataRows = $("tr.doc"); | |
max = dataRows.length; | |
getNext = function() { | |
if (curr < max) { | |
row = $(dataRows[curr]); | |
csv += "\n" + row.data().docId + ',"' + row.find(".account")[0].innerText.trim() + '","' + row.find(".date")[0].innerText.trim() + '"'; | |
row.find("a.download")[0].click(); | |
curr += 1; | |
window.setTimeout(getNext,delayInSeconds*1000); | |
} else if (nextPage.length > 0) { | |
nextPage[0].click(); | |
window.setTimeout(download,delayInSeconds*1000); | |
} else { | |
console.log(csv.substr(1)); | |
} | |
} | |
getNext(); | |
} | |
download(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Navigate to your Manilla All Documents page and paste this into your browser's console. Should be cross-browser compatible but not tested. When it's done, it will output a CSV representation of the account and date of each document to the console.