def GetMutualFriendListWithFacebookUserID(profile, facebookUserID): friendList = [] try: graph = facebook.GraphAPI(GetProfileAuthToken(profile)) mutualFriendsData = graph.get_connections("me","mutualFriends/"+str(facebookUserID))["data"] for friendData in mutualFriendsData: facebookUser = FacebookUser(facebookID=friendData["id"]) #create a facebookUser object but don't save. We don't care about having this in the db facebookUser.updateUsingFacebookDictionary(friendData) friendList.append(facebookUser) friendList = OrderByNumberOfMutualFriends(profile,friendList) except: print 'error when retrieving mutual friendList' return friendList
def createFacebookUser(friendFacebookData): facebookUser = FacebookUser(facebookID = friendFacebookData['id']) facebookUser.updateUsingFacebookDictionary(friendFacebookData) return facebookUser
def createFacebookUser(friendFacebookData): facebookUser = FacebookUser(facebookID=friendFacebookData['id']) facebookUser.updateUsingFacebookDictionary(friendFacebookData) return facebookUser