searchPost: Searching for Google+ Posts

Description Usage Arguments Details Value See Also Examples

View source: R/search.R

Description

This function uses the Google+ API to search for a text string in posts. Optionally, search results can be restricted to a certain language.

Usage

1
2
searchPost(q, ret = "data.frame", language = NULL, results = 1,
  nextToken = NULL, cr = 0)

Arguments

q

The query string to search. The string is URL encoded automatically.

ret

A string specifying the kind of return value. Either a list of the retrieved items on the page, or that list parsed into a data.frame.

language

A language code. See https://developers.google.com/+/api/search#available-languages.

results

The approximate number of results that will be retrieved from Google+.

nextToken,cr

used internally to retrieve additional pages of answers from the Google+ API. Users won't need to set this argument.

Details

The result is either a simple list of items from the page that can be parsed using parsePost or a data frame with that function already applied.

The length of the list or the number of rows of the data frame are somewhat ambiguous. Specifying the results argument will try to get that many results. But there may be less (because Google could not find more) or more (because Google is organizing results on pages and it would be a waste to discard them automatically). If you really depend on getting not more rows than you expected, use standard selection (i.e. [) to trim the results.

Value

The function returns a list or a data frame containing all available data on the posts that met the search criteria. See Details for more on its content.

See Also

Google+ API documentation: https://developers.google.com/+/api/latest/activities/search.

Examples

1
2
3
4
## Not run: 
searchPost("#cats")

## End(Not run)

plusser documentation built on May 2, 2019, 8:17 a.m.