Skip to content

Instantly share code, notes, and snippets.

@kjgarza
Created July 22, 2012 12:22
Show Gist options
  • Save kjgarza/3159501 to your computer and use it in GitHub Desktop.
Save kjgarza/3159501 to your computer and use it in GitHub Desktop.
get publisher information from google scholar searches
var publ = document.querySelectorAll(".gs_a");
var dl =[];
for(i=0; i<publ.length; i++) {
var n = (publ[i].innerHTML).split("-");
dl[i] = n[1];
}
var result = {}, max = 0, res;
for(var v in dl) {
result[dl[v]] = (result[dl[v]] || 0) + 1;
if(result[dl[v]] > max) { max = result[dl[v]]; res = dl[v]; }
}
console.log(res);
console.log(dl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment