Created
September 19, 2021 21:54
-
-
Save saitho/f994203a449e7791f8fcefcb825834ec to your computer and use it in GitHub Desktop.
Archive of our Own - Get Top 30 Series by count
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
// https://archiveofourown.org/media/Anime%20*a*%20Manga/fandoms | |
const series = []; | |
for(const a of document.querySelectorAll('.fandom .tag')) { | |
let m = /(.*) \((\d+)\)/.exec(a.parentNode.innerText); | |
if (m !== null) { | |
series.push({title: m[1], count: m[2]}) | |
} | |
} | |
series.sort(function(a, b) { | |
return a.count - b.count; | |
}).reverse(); | |
let len = 30; | |
//len = series.length; | |
let content = ''; | |
for(let i=0; i < len; i++) { | |
content += i+1 + '. ' + series[i].title + ' - ' + series[i].count + '\n'; | |
} | |
console.log(content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment