Created
March 13, 2017 11:49
-
-
Save phenomist/ce12025a6c2fbebec529fa26d2d7677b to your computer and use it in GitHub Desktop.
JS script to create easily pastable LearnedLeague city counts
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
x = document.body.innerHTML.split("<table class=\"l\">")[1].split("</table>")[0].split("<td class=\"city\">"); | |
names = []; | |
counts = []; | |
for(i = 1; i < x.length; i++){ | |
z = x[i].split("</td>"); | |
names[i-1] = z[0]; | |
counts[i-1] = z.length-2; | |
} | |
x = "" | |
for(i = 0; i < names.length; i++){ | |
x += names[i]+"\t"+counts[i]+"\n"; | |
} | |
console.log(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment