getShares: Extract list of users who publicly shared a public Facebook...

Description Usage Arguments Details Author(s) See Also Examples

View source: R/getShares.R

Description

getShares retrieves a list of posts that correspond to shares of a post on a public Facebook page. Only public posts by users who have granted authorization to the app used to authenticate.

Usage

1
getShares(post, token, n = 100)

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 fbOAuth.

n

numeric, maximum number of shares to return.

Details

getShares returns a data frame with four variables: from_name (the name of the user who shared the post), from_id (the ID of the user who shared the post), shared_time (the time at which the post was shared), and id (the ID of the new post).

For more information on why not all shared posts are returned, see here: https://developers.facebook.com/bugs/1404733043148335/

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 shares of most recent post
shares <- getShares(post=fb_page$id[1], n=2000, token=fb_oauth)

## End(Not run)

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