getCommentReplies: Extract replies to comments on page post

Description Usage Arguments Details Author(s) See Also Examples

View source: R/getCommentReplies.R

Description

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

Usage

1
2
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.

Author(s)

Yan Turgeon

See Also

getPage, getPost

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

## End(Not run)

Rfacebook documentation built on May 1, 2019, 8:40 p.m.