Skip to content

Instantly share code, notes, and snippets.

@rinogo
Last active July 27, 2022 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rinogo/acbb15065c4b2fecc82f163423925571 to your computer and use it in GitHub Desktop.
Save rinogo/acbb15065c4b2fecc82f163423925571 to your computer and use it in GitHub Desktop.
Convert exported/downloaded Facebook friends file into a simple list of names or links (e.g. LinkedIn search URLs)
/*
Instructions:
1. Download your contacts from Facebook's Settings area. When prompted to choose certain categories of data to export, you only need to select the "Friends" option.
2. You'll eventually be sent an email with a link to download your data.
3. Download the zip file and extract its contents. Within the `friends_and_followers` folder, open `friends.json`.
4. Copy the contents of that file into the line below marked, "Replace this line...".
5. In Chrome, type Cmd + Opt + J to open the Javascript Console or access View > Developer > Javascript Console.
6. Copy this entire file (with your data substituted at the appropriate line) into the Javascript Console and hit enter to execute the command.
7. The Console should generate a list of just the names of your friends which can be used however you like (e.g. for uploading to another service). There should be a small "Copy" button you can use to copy out the data.
*/
let data =
/******** Replace this line with the contents of `friends.json` ********/
console.log(data.friends_v2.reduce((last, f) => `${last}\n${f.name}`, ''));
//To get LinkedIn search links instead, comment out the line above and uncomment the line below:
//console.log(data.friends_v2.reduce((last, f) => `${last}\n${new URL('https://www.linkedin.com/search/results/all/?keywords=' + f.name)}`, ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment