Takes names from Apple contacts and Facebook friends, and combines them and cleans them up.
-
Clone or download the repository.
-
Running the script requires Python. (Works with Python 2 and 3. Check for Python in terminal with:
python -V
)
-
Open the Contacts app for mac.
-
Select all the contacts you want to include (for all of them,
⌘A
) -
Export the contacts as vCards (File > Export > Export vCard)
-
Move the export to
contacts_files/contacts.vcf
:
$ mv <path_to_export> <path_to_repo>/contacts_files/contacts.vcf
The file should contain something like this:
N:Russ;Newton;;;
FN:Russ Newton
TEL;type=CELL;type=VOICE;type=pref:
-
Go to the Facebook page that has all your friends.
-
Scroll to the bottom of the page so all your friends load and display.
-
Copy the contents of the entire page (
⌘A
) -
Make a
facebook_friends.txt
file in thecontacts_files
directory. -
Paste the Facebook page contents into the
facebook_friends.txt
file.
The file should contain something like this:
Close Friend
Friends
Russell Newton
16 mutual friends
$ python contacts.py
The output will be the names from all the contacts and friends.
To remove a name from the output, add a remove.txt
file to contacts_files
and put one name on each line:
Lorene Stone
Jamie Hansen
To combine several names into one name, add a combine_and_convert.csv
file to contacts_files
and put comma separated names that you want combined. The output will always use only the first name on each line:
Russ Newton,Russell Newton
From the contacts
directory, run:
$ python -m unittest discover tests