This tool lets you download a CSV of your 1st & 2nd degree connections
You'll need to have python, pip, and Google Chrome installed to use this tool. Once that's all set up:
- Clone this repository
cd
into the cloned folderpip install -r requirements.txt
Getting your list of friends is no longer possible via the Facebook Graph API, so you can use this. It has 2 modes:
- Download a list of your connections, and
- Download a list of your 2nd-degree connections for social network analysis. Both modes save data to a CSV in a format friendly for importing into graph databases.
- Run
python facebook-connections.py
- It will open a browser window. Fill out your username & password and log in.
- Press Enter in the terminal after logging in.
- You should see your Facebook friends page scroll to the bottom.
- A CSV file will be created with the data (1st-degree_YYYY-MM-DD_HHMM.csv)
Note: This could take days if you have lots of friends!
- Get your 1st degree connections first, so you have the 1st-degree CSV file.
- Put the 1st-degree CSV in the same folder as python facebook-connections.py
- Run
python facebook-connections.py 1st-degree_YYYY-MM-DD_HHMM.csv
, with the actual filename from the first step. - A browser window will open. Fill out your username & password and log in.
- Press Enter in the terminal after logging in.
- You should the script looping through your Facebook friends' friend pages.
- A CSV file will be created with the data (2nd-degree_YYYY-MM-DD_HHMM.csv)
Note: This currently gets tripped up by the following situations, because the scroll_to_bottom() function doesn't accurately detect when it's at the bottom of the friends list. Please feel free to improve with a pull request!
- Friends that have their privacy settings to show no friends
- Friends with just followers public
- Rarely, some other situations