Created
October 17, 2020 17:08
-
-
Save carboleda/a6484431e58e0af4860484f4d509b6f3 to your computer and use it in GitHub Desktop.
Extract comments by user in Streamyard
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
// Extract comments by user in Streamyard | |
var nickComments = {}; | |
document | |
.querySelectorAll('.PlatformCommentList__List-dYPHyO.jgefvQ li span.lhUFXI') | |
.forEach(el => { | |
var nick = el.innerText; | |
if (!nickComments[nick]) nickComments[nick] = 0; | |
nickComments[nick] += 1; | |
}); | |
var csv = Object.keys(nickComments) | |
.filter(item => []) | |
.map(key => { | |
return `${key}\t${nickComments[key]}`; | |
}).join('\n'); | |
console.log(csv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment