Last active
March 24, 2019 02:02
-
-
Save drewchapin/0e7eeaaa20f8c6695563bd4b121024c4 to your computer and use it in GitHub Desktop.
Go to a person's Facebook friends list. Scroll until all friends are loaded. Run script in Console and it will produce a log group of "Friend Name: <profile-link>"
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
var divs = document.getElementsByTagName("div"); | |
var list = new Array(); | |
for( var i = 0; i < divs.length; i++ ) { | |
if( divs[i].getAttribute("data-testid") == "friend_list_item") { | |
var friend = divs[i].getElementsByClassName("fwb")[0]; | |
var profile = friend.getElementsByTagName("a")[0]; | |
list.push(friend.innerText + ": " + profile.href); | |
} | |
} | |
console.log(list.length+" friends"); | |
document.write(list.sort().join("<br/>")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment