An inside look at my new Facebook app and how I made it
Inspired by my recent dive into social network analysis and Malcolm Gladwell’s book “The Tipping Point,” I decided to make a little Facebook app: Are you a Connector?
When I read “The Tipping Point” a couple of years ago, I, like I assume others have, used Gladwell’s test to see if I am a ‘Connector’ by counting up the number of my contacts with the surnames from his list.
I got a score in the low 20′s then and I’m still around 23 today — this time according to my Facebook connections.
So I thought it would be fun to make a Facebook app that uses the Graph API to match the surnames of your Facebook friends with those on Gladwell’s list to give you a score the same way his test does. It’s not an exact science, but generally if you have significantly more than the average score for your age range then you are likely a Connector. Kind of cool, right?
So if you check out my app you’ll see I explain what a connector is (someone who knows a lot of people, more than most) and what your score means. You won’t get a straight answer such as “Congrats! You’re a Connector!” or “Sorry, dude. You’re not a Connector. Have you tried Meetup.com?” because there is no exact value to confirm whether or not you are. You can check out the chart I made (right) based on Gladwell’s averages to see where you fall for your age range and see that you are either about average, slightly above average or way above average in Gladwell’s ‘Connector’ zone. 
For more background on the ‘Connector’ test, read “The Tipping Point” or check out Gladwell’s excerpt on his blog.
How I created the app
I was pleasantly surprised by how easy it was to get started creating a Facebook app. (Go to http://facebook.com/developers to get started with your own app!) I decided to use Facebook’s PHP SDK and couldn’t believe that it took me only 4 hours (from about 10 p.m. to 2 a.m. MST Sunday night) to create my app. Then I did a little IE debugging and cleaned it up before sharing it with my fellow Facebook friends tonight — super easy!
So, following Gladwell’s guidelines for getting a ‘Connector’ score, I set up my new Facebook app by downloading the PHP SDK from GitHub and using that to pull in the Graph API.
The SDK makes it easy for you to pull in user Facebook data using the Graph API:
if ($session) {
try {
$uid = $facebook->getUser(); //This (obviously) gets the user
$me = $facebook->api('/me'); //This pulls the user's Facebook data
And I just added one more variable to grab the app user’s list of friends:
$myFriends = $facebook->api('/me/friends');
Then I created an array of the friends’ names:
$friendsData = $myFriends['data'];
To finish it up, I looped through each friend’s name, adding a test for people with three+ names and a test to see if each last name matched one of the 250 surnames from Gladwell’s list. And voilà — your count = your ‘Connector’ score.
Your Score: $count;
Some snags I ran into:
- For whatever reason (something having to do with Canvas), there is a bug in IE (of course) that causes iframed Facebook apps to keep refreshing the page over and over. To fix this, just add this before the HTML:
header('P3P: CP="CAO PSA OUR"'); - You need to request permission to post results, status updates, or get other user info like birthdays and work history if you want to use it in your app. To do this add the following to your authentication code and you should be set (See Facebook’s developer docs on extended permissions):
$session = $facebook->getSession(); $loginUrl = $facebook->getLoginUrl( array( 'canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'email,publish_stream,status_update,user_birthday,' ) );
So that’s it. I hope you enjoy the app! And as always, I welcome feedback and questions.
