getPage {Rfacebook} | R Documentation |
Extract list of posts from a public Facebook page
Description
getPage
retrieves information from a public Facebook page. Note that
information about users that have turned on the "follow" option on their
profile can also be retrieved with this function.
Usage
getPage(page, token, n = 25, since = NULL, until = NULL, feed = FALSE,
reactions = FALSE, verbose = TRUE, api = NULL)
Arguments
page |
A page ID or page name. |
token |
Either a temporary access token created at
https://developers.facebook.com/tools/explorer or the OAuth token
created with |
n |
Number of posts of page to return. Note that number can be sometimes higher or lower, depending on status of API. |
since |
A UNIX timestamp or strtotime data value that points to the start of the time range to be searched. For more information on the accepted values, see: http://php.net/manual/en/function.strtotime.php |
until |
A UNIX timestamp or strtotime data value that points to the end of the time range to be searched. For more information on the accepted values, see: http://php.net/manual/en/function.strtotime.php |
feed |
If |
reactions |
If |
verbose |
If |
api |
API version. e.g. "v2.8". |
Details
This function will only return information from public pages, not users with public profiles.
The since
and until
parameters are applied to the updated_time
field in the post objects, and not the created_time
. As a result, this function
might return old posts that have been updated recently.
comments_count
refers to the total of comments, including nested comments (replies).
It might be different from the total number of comments available through the API 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 posts on Humans of New York page, including posts by others users
## (not only owner of page)
page <- getPage(page="humansofnewyork", token=fb_oauth, feed=TRUE)
## Getting posts on Humans of New York page in January 2013
page <- getPage(page="humansofnewyork", token=fb_oauth, n=1000,
since='2013/01/01', until='2013/01/31')
## End(Not run)