facebook.search: Perform a search on Facebook

Description Usage Arguments Value Author(s) See Also Examples

View source: R/facebook.search.R

Description

facebook.search retrieves public content that mention a given keyword(s) and for a given type. Please note that each type has its unique set of fields, as referenced on official documentation https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#search

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

Usage

1
2
facebook.search(query, token, parameters = list(),
  n = getOption("facebook.maxitems"), type = c("page", "group"))

Arguments

query

A character vector vector containing keywords to search in OR condition.

token

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

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

Maximum number of elements to return for each type.

type

A character vector containing the types of content to get. Valid content types are user, page, event, group, place

Value

A FacebookMixedCollection-class collection with the id and the type for each element included.

Author(s)

Gabriele Baldassarre https://gabrielebaldassarre.com

See Also

fbOAuth

Examples

1
2
3
4
5
6
7
## Not run: 
## See examples for fbOAuth to know how token was created.
## Searching 100 public pages that mention cats
 load("fb_oauth")
pages <- facebook.search(query="cats", type="page", token=fb_oauth, n=100)

## End(Not run)

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