Skip to content

Instantly share code, notes, and snippets.

@RayBB
Created June 24, 2017 04:00
Show Gist options
  • Save RayBB/7f87cc5ef2c2c1eece86af7208c51fea to your computer and use it in GitHub Desktop.
Save RayBB/7f87cc5ef2c2c1eece86af7208c51fea to your computer and use it in GitHub Desktop.
Counts all the friends your friends have on facebook.
/*
Just go to your facebook profile, hit the friends tab.
Scroll all the way down until all your friends are loaded
Then past this command into the browser
Note: This only counds the people that have a status under their name listing the number of friends.
Like so:
First Last
1,335 friends
It doesn't count when there are mutual friends shown.
*/
document.body.innerText
.match(/\d*[,]*\d* friends/g)
.map(e => parseInt(0+e.replace(" friends", "")
.replace(",","")))
.reduce((a,b) => a+b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment