Learn R Programming

plusser (version 0.3-5)

harvestPage: Retrieve the posts of a user's G+ page

Description

This function retrieves the most recent posts that a user put on her page. Google calls this `listing activities`.

Usage

harvestPage(user, ret = "data.frame", results = 1, nextToken = NULL,
  cr = 1)

Arguments

user
A user identification string: either user ID or +Name.
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.
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 these arguments.

Value

  • The function returns a list or a data frame. See Details for more on its content.

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.

See Also

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

Examples

Run this code
myPosts.df <- harvestPage("115046504166916768425")
gPosts.df <- harvestPage("+google", results=200)

Run the code above in your browser using DataLab