Rfacebook (version 0.6.15)

getCommentReplies: Extract replies to comments on page post

Description

getCommentReplies retrieves the list of comments replying to an individual comment on a post by a public Facebook page.

Usage

getCommentReplies(comment_id, token, n = 500, replies = TRUE,
  likes = FALSE, n.likes = n, n.replies = n, api = NULL)

Arguments

comment_id
A comment ID
token
Either a temporary access token created at https://developers.facebook.com/tools/explorer or the OAuth token created with fbOAuth.
n
numeric, maximum number of replies and likes to return.
replies
logical, default is TRUE, which will return data frame with replies to the post.
likes
logical, default is TRUE, which will return data frame with likes for the post.
n.likes
numeric, maximum number of likes to return. Default is n.
n.replies
numeric, maximum number of replies to return. Default is n.
api
API version. e.g. "v2.8". NULL is the default.

Details

getCommentReplies returns a list with three components: comment, replies, and likes. First, comment contains information about the original comment: author, creation date, id, counts of likes and comments, etc. Second, replies is a data frame with information about the replies to the comment (author, message, creation time, id). Finally, likes is data frame that contains names and Facebook IDs of all the users that liked the comment.

See Also

getPage, getPost

Examples

Run this code
## Not run: ------------------------------------
# ## See examples for fbOAuth to know how token was created.
# ## Getting information about Facebook's Facebook Page
#  load("fb_oauth")
#  fb_page <- getPage(page="facebook", token=fb_oauth)
# ## Getting information and likes/comments about most recent post
#  post <- getPost(post=fb_page$id[1], n=2000, token=fb_oauth)
# ## Downloading list of replies to first comment
#  replies <- getCommentReplies(comment_id=post$comments$id[1], token=fb_oauth)
## ---------------------------------------------

Run the code above in your browser using DataCamp Workspace