In my previous post I had talked about some of the stats I pulled from Facebook about it’s usage by my friends. This was an ad-hoc number crunching done just because I was bored and got curious. After the post went live a friend of mine, Ankush asked for more details on how I generated the numbers so in this post I am going to go over my process and how I got the numbers I shared.
Before we start, keep in mind that this is all data that is publicly available on FB, or at least shared with me. If you don’t want others to generate data about your activity on FB, you should change your privacy settings on FB and restrict access. Please don’t try to use this information to try to get access to data you are not supposed to. You will get in trouble and I will not take responsibility for it. Now that all that is out of the way, lets get to the details of the process.
The first thing you need is to have the Facebook Command Line client installed. Instructions on how to install are here so I am not going to repost them here. Make sure you authenticate the install and follow the steps in ‘Obtain Additional Authorization’ section of the installation guide otherwise the rest of the guide won’t be of much use to you.
Once you have FBCMD installed and configured, you can start playing with the options. Check out fbcmd Commands for the list of available options. You can also run the script with –help for the same.
/usr/bin/php /var/www/fbcmd/lib/fbcmd/fbcmd.php --help
Since I was interested in the photos uploaded the first command I ran was:
/usr/bin/php /var/www/fbcmd/lib/fbcmd/fbcmd.php OPICS =all FB_Pics
This command gets all the photos uploaded by folks in my friend list and downloaded them to the FB_Pics folder. As I mentioned in the previous post, this downloaded over 58k photos to my system. So be careful when you run it. You can also restrict it to a particular user by passing their name as a parameter.
To get the wall post count’s of all my friends, I ran the following command:
/usr/bin/php /var/www/fbcmd/lib/fbcmd/fbcmd.php FINFO wall_count =all
This gave me a output similar to the following:
Suramya Tomar 247
I took this output, put it in an Excel file and did some analysis on it to get the max post count, least post count, Total count and top 10 user post counts. I could have done this using shell commands as well, but since this was a one time task I didn’t see the point. Maybe in the future I could set up a job that would do this periodically and do trending on the data but lets see. I don’t see much use for this data except for the coolness factor and to satisfy my curiosity.
Getting the birthday count was as easy as running the following command:
/usr/bin/php /var/www/fbcmd/lib/fbcmd/fbcmd.php FINFO birthday_date =all |wc -l
This returned the number of folks who had shared their birthday’s on FB and then I got the current location count using the following command:
/usr/bin/php /var/www/fbcmd/lib/fbcmd/fbcmd.php FINFO current_location =all |wc -l
So there you have it. This is how I generated the numbers I had posted earlier. As you can see there is nothing too complicated about it, so if you want you can generate similar stats for your friends as well.
Let me know if you have any questions and I will do my best to answer.
Well this is all for now. I should go and get some sleep now.