getPost {Rfacebook} | R Documentation |
Extract information about a public Facebook post
Description
getPost
retrieves information about a public Facebook post, including
list of comments and likes.
Usage
getPost(post, token, n = 500, comments = TRUE, likes = (!reactions),
reactions = FALSE, n.likes = n, n.comments = n, n.reactions = n,
api = NULL)
Arguments
post |
A post ID |
token |
Either a temporary access token created at
https://developers.facebook.com/tools/explorer or the OAuth token
created with |
n |
numeric, maximum number of comments and likes to return. |
comments |
logical, default is |
likes |
logical, default is |
reactions |
logical, default is |
n.likes |
numeric, maximum number of likes to return. Default is |
n.comments |
numeric, maximum number of comments to return. Default is
|
n.reactions |
numeric, maximum number of reactions to return. Default is
|
api |
API version. e.g. "v2.8". |
Details
getPost
returns a list with up to four components: post
,
likes
, comments
, and reactions
.
post
contains information about the post: author, creation date, id,
counts of likes, comments, and shares, etc.
likes
is a data frame that contains names and Facebook IDs of all
the users that liked the post.
comments
is a data frame with information about the comments to
the post (author, message, creation time, id). To download also the replies
to specific comments, see getCommentReplies
. Note that the total
number of comments may be different from the number report in comments_count
if some comments have been deleted.
Author(s)
Pablo Barbera pablo.barbera@nyu.edu
See Also
Examples
## 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)
## End(Not run)