Yes I am still alive and well. It has been a significantly crazy past few months. Work has really ramped up due to staffing cuts and people jumping ship. We finally have a few additions to the team, which has been a very welcome addition. Thanks for your patience and let’s get back to that code that I promised about data mining FB!
Jon Newman’s FB Cmdlets sit at the core of this exercise.
You can download the module from the following Codeplex link: http://facebookpsmodule.codeplex.com/
In a previous post I explained how to Authenticate to FB through the module and that info can be found here: https://scriptwarrior.wordpress.com/2011/05/10/updating-facebook-from-powershell/
Once you have the FB Token in your session it is now time to start grabbing your pick axe and jack hammer.
Let’s start mining!
First let’s get a list of our friends…with the interestingly name cmdlet Get-FBFriends
PS C:\Windows\system32> Get-FBFriends
2012706 Sona Simova
3006152 Peter Seymour
5201880 Bryan Armalavage
5501594 Jorge Segarra
10237556 Ben Anderson
Now that we have our list we can pipe that list to Get-FBObjectData which will get us more information.
Then we can use the Select-Object cmdlet to get just the information that we want about our friends.
Let’s say for instance we want to find some info on all of our female friends. Here goes 🙂
#List of Facebook friends that are ladies with their Name, Gender and Relationship_Status
$Ladies = Get-FBFriends | Get-FBObjectData | Select Name, Gender, Relationship_status | where Gender -eq female
#Now let's just group by the Relationship_Status and BOOYA! Friend Stats :)
$Ladies | Group Relationship_Status | Select Count, Name
21 In a relationship
1 It’s complicated