facebook.participants: Pull the list of participants from a set of inbox...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/facebook.participants.R

Description

facebook.participants pulls information about the users and the pages who took part of a set of inbox conversations in a link{FacebookConversationsCollection-class} and push into a FacebookMixedCollection-class instance.

Usage

1
2
facebook.participants(id, token = NULL, parameters = list(),
  n = getOption("facebook.maxitems"), .progress = create_progress_bar())

Arguments

id

An existing FacebookConversationsCollection.

token

Either a temporary access token created at https://developers.facebook.com/tools/explorer or the OAuth token created with fbOAuth. If it's NULL, the token from id is used. Otherwise, no query is performed to the Facebook Graph API and an empty Collection is returned.

parameters

A list of parameters to be added to the Facebook Graph API query. For more information on the accepted parameters, see: https://developers.facebook.com/docs/graph-api/using-graph-api.

n

An integer value with the maximum number of participants to be pulled for each conversation in id. It can be set to Inf to pull out any participant of a given conversation and assumes the default value to facebook.maxitems global option if missing.

.progress

progress_bar object as defined in the plyr package. By default the none progress bar is used, which prints nothing to the console. See create_progress_bar for details.

Details

This function requires the use of a OAuth page access token with read_pages_mailboxes permission granted if id is a collection of pages conversations or a user access token with read_mailbox permission granted and when the users are developers for the application making the request if id is a collection of users' conversations.

Only the id and the type is returned in a mixed collection. Then, a proper collection for each type could be built accordingly.

Since this is a finder function, duplicated id won't be removed to the output collection if they have a different parent.

Value

A collection of users and pages in a FacebookMixedCollection-class object with the id and the type for each element included.

Author(s)

Gabriele Baldassarre https://gabrielebaldassarre.com

See Also

FacebookConversationsCollection, facebook.search, facebook.senders

Other FacebookFinders: facebook.senders

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
## See examples for fbOAuth to know how token was created.
 load("fb_oauth")
 
## Returns the conversations of the current user
 my.conversations <- FacebookUsersCollection(id="me", fb_oauth) %>%
    FacebookConversationsCollection()
 
## Who talks to the current users
 participants <- facebook.participants(my.conversations) %>% FacebookUsersCollection()

## End(Not run)

facebook.S4 documentation built on May 2, 2019, 4 a.m.