Skip to content

Instantly share code, notes, and snippets.

@alexgleason
Created May 23, 2016 02:39
Show Gist options
  • Save alexgleason/6f43a10aa8e9abc6ca8a2acd7b4ed762 to your computer and use it in GitHub Desktop.
Save alexgleason/6f43a10aa8e9abc6ca8a2acd7b4ed762 to your computer and use it in GitHub Desktop.
Takes the names of group members in a Facebook group and prints them as CSV output.
/*
Takes the names of group members in a Facebook group and prints them as CSV output.
*/
function facebookGroupMemberNamesToCsv() {
var people = document.querySelectorAll('.fsl.fwb.fcb a');
var output = 'First Name,Last Name\n';
for (var i=0; i<people.length; i++) {
names = (people[i].innerHTML).split(' ');
output += names[0] + ',' + names[names.length-1] + '\n';
}
console.log(output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment