Last active
January 3, 2016 01:59
-
-
Save owenversteeg/8392822 to your computer and use it in GitHub Desktop.
Bookmarklet for collecting Google Docs contributor data into .tsv format. In order to use it, you must first expand the contributor list (and then run this in the console.) You can modify the call to console.log if you want the data to be alerted. (Of course, you can't copy the data unless it's console.logged.)
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
javascript:function getCollaboratorDetails() { var collaboratorsElements = document.getElementsByClassName('docs-revisions-tile-collaborator'); var collaborators = []; var returnText = "Name\tContributions\n";for (var i=0; i<collaboratorsElements.length; i++) { collaborators[collaboratorsElements[i].innerText] = (collaborators[collaboratorsElements[i].innerText]+1 || 1); } console.log(Object.keys(collaborators)); for (var i=0; i<Object.keys(collaborators).length; i++) { returnText += Object.keys(collaborators)[i] + "\t" + collaborators[Object.keys(collaborators)[i]] + "\n" } return returnText; } console.log(getCollaboratorDetails()); |
I also apologize for the horrible code quality; it was my first priority to get something working when I wrote this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If anyone's curious, it's TSV because gdocs doesn't accept copy/paste in CSV. It can be CSV if you just modify the
"\t"s to ","s.