Created
July 22, 2012 12:22
-
-
Save kjgarza/3159501 to your computer and use it in GitHub Desktop.
get publisher information from google scholar searches
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
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