getFriends function

Extract list of friends with their information

Extract list of friends with their information

getFriends retrieves information about the user's friends.

getFriends(token, simplify = FALSE)

Arguments

  • token: Either a temporary access token created at https://developers.facebook.com/tools/explorer or the OAuth token created with fbOAuth.
  • simplify: If TRUE, function will return only name and id for each friend. If FALSE, it will return additional information from their profiles: gender, birthday, location, hometown, relationship status and profile picture.

Details

This function requires the use of a OAuth token with extended permissions. After the introduction of version 2.0 of the Graph API, only friends who are using the application that you used to generate the token to query the API will be returned.

Examples

## Not run: ## Copy and paste token created at FB Graph API Explorer token <- "XXXXXX" my_friends <- getFriends(token=token, simplify=TRUE) ## Since users are ordered by ID, this will return 10 oldest user accounts head(my_friends, n=10) ## End(Not run)

Author(s)

Pablo Barbera pablo.barbera@nyu.edu

See Also

getUsers, fbOAuth