Created
November 20, 2018 08:52
-
-
Save karataev/2ae334cfa8309ba086e7e536568e45b6 to your computer and use it in GitHub Desktop.
Parse list of users from a post and save it to .csv file
This file contains hidden or 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
// open a list of users who interact with a post by clicking a number below the post | |
// execute function below in the browser's console | |
// PROFIT | |
(function() { | |
let result = []; | |
document.querySelectorAll('#reaction_profile_browser > li > div > div > div > div > div > div > a').forEach(item => result.push(item.textContent)); | |
let csvContent = "data:text/csv;charset=utf-8,"; | |
csvContent += result.join('\r\n'); | |
let encodedUri = encodeURI(csvContent); | |
let link = document.createElement("a"); | |
link.setAttribute("href", encodedUri); | |
link.setAttribute("download", "users.csv"); | |
document.body.appendChild(link); // Required for FF | |
link.click(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment