facebook.object.likes: Pull all the public likes of Facebook users or pages

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

View source: R/facebook.object.likes.R

Description

facebook.object.likes pulls information about the likes from a list of Facebook IDs and/or names of users or pages and push them into a FacebookMixedCollection-class instance.

Usage

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

Arguments

id

An existing FacebookUsersCollection or FacebookPagesCollection

token

Either a temporary access token created at https://developers.facebook.com/tools/explorer or the OAuth token created with fbOAuth. If NULL and id is a Collection, get that one instead. 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.

Details

This function requires the use of a OAuth token with user_likes permission granted. After the introduction of version 2.0 of the Graph API, only likes from users who are using the application that you used to generate the token to query the API will be returned.

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

Value

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

Author(s)

Gabriele Baldassarre https://gabrielebaldassarre.com

See Also

facebook.search, fbOAuth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
## See examples for fbOAuth to know how token was created.
 load("fb_oauth")
 
## Returns the id and the type of the current user's likes
 me.likes <- facebook.users.likes(id = "me", token = fb_oauth)
 
## Do the same, but starting from a users collection
 me.likes <- FacebookUsersCollection(id="me", fb_oauth) %>% facebook.users.likes()
 
## Build a pages collection from all the pages (and ONLY the pages)
## the current user likes
 me.likes.pages <- me.likes %>% FacebookPagesCollection()

## End(Not run)

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