Extract total count of reactions to one or more Facebook posts

Description

getReactions retrieves information from a single or multiple posts, returning the total count of reactions of each type (like, love, haha, wow, sad, angry).

Usage

1
getReactions(post, token, verbose = TRUE)

Arguments

post

A post ID, or a vector of post IDs

token

Either a temporary access token created at https://developers.facebook.com/tools/explorer or the OAuth token created with fbOAuth.

verbose

logical, default is TRUE, which will print additional information on the console.

Details

The solution implemented here is based on this Stack Overflow response: http://stackoverflow.com/questions/36930414/how-can-i-get-facebook-graph-api-reaction-summary-count-separately

Author(s)

Pablo Barbera pablo.barbera@nyu.edu

See Also

getPage, getPost

Examples

1
2
3
4
5
6
7
8
9
## 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 reactions for most recent post
post <- getReactions(post=fb_page$id[1], token=fb_oauth)

## End(Not run)