Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
def createFacebookUser(friendFacebookData):
    facebookUser = FacebookUser(facebookID = friendFacebookData['id'])
    facebookUser.updateUsingFacebookDictionary(friendFacebookData)
    return facebookUser
Ejemplo n.º 3
0
def createFacebookUser(friendFacebookData):
    facebookUser = FacebookUser(facebookID=friendFacebookData['id'])
    facebookUser.updateUsingFacebookDictionary(friendFacebookData)
    return facebookUser