Skip to content

Instantly share code, notes, and snippets.

@karataev
Created November 20, 2018 08:52
Show Gist options
  • Save karataev/2ae334cfa8309ba086e7e536568e45b6 to your computer and use it in GitHub Desktop.
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
// 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