The next post will complete my review of the MAKE Rovera 2WD Arduino Robot Kit. I’ve been busy with vacation, work travel, and other projects. One of the small side projects that distracted me may be of interest to some readers. It’s my first foray into the Facebook API and using some of the data it makes available about you and your friends. Inspired by Kieran Healy’s blog post Using Metadata to Find Paul Revere I decided to look at the “page likes” that my friends and I had on Facebook, and see who among us had the most similar likes, and some related data. I wrote a python script to retried and analyze the data. You can read the full readme and download the script on my GitHub repository.
The script prints out:
- The three pages that have the most likes amongst you and your friends
- The friend most similar to you in terms of page likes (using the Jaccard coeffiecient as the measure (see http://en.wikipedia.org/wiki/Jaccard_index), and
- The two friends who are most similar to each other in terms of page likes (again, using the same metric and printing out the same information)
Sample output:
The three Facebook pages most liked by you and your friends are:
Abney Park with 8.0 likes
Philadelphia Phillies with 7.0 likes
Philadelphia Eagles with 7.0 likes
The most similar friend to me is John Smith The correlation between page likes, on a 0 to 100% score, is: 3% The page likes we have in common are: [u’The Big Bang Theory’, u’Philadelphia Eagles’]
The two most similar friends are [u’Ed Jones’, u’Doug Anderson’] The correlation between their page likes, on a 0 to 100% score, is: 8% The pages they have in common are: [u’Bruce Springsteen’, u’American Graffiti’, u’The Beatles’, u’Pittsburgh Pirates’, u’Casablanca’]
The program does NOT get the required Facebook user access token for account. You need to go to https://developers.facebook.com/tools/explorer/ to do so, and then paste it where indicated in the program.
I’ve also got to give a shout out to Programming Collective Intelligence by Toby Segaran for some of the ideas used.