Created
May 23, 2016 02:39
-
-
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.
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
/* | |
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