Skip to content

Instantly share code, notes, and snippets.

@phenomist
Created March 13, 2017 11:49
Show Gist options
  • Save phenomist/ce12025a6c2fbebec529fa26d2d7677b to your computer and use it in GitHub Desktop.
Save phenomist/ce12025a6c2fbebec529fa26d2d7677b to your computer and use it in GitHub Desktop.
JS script to create easily pastable LearnedLeague city counts
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