Description Usage Arguments Details Value See Also Examples
This function retrieves the most recent posts that a user put on her page. Google calls this 'listing activities'.
1 2 | harvestPage(user, parseFun = parsePost, results = 1, nextToken = NULL,
cr = 1)
|
user |
A user identification string: either user ID or +Name. |
parseFun |
A function for parsing the results, e.g.
the supplied |
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. |
The result is either a simple list of items from the page
that can be parsed using e.g. parsePost
or a
data frame with that (or another user-supplied) function
already applied.
When writing your own parsing functions, make sure that the
function takes a single list item from the raw list as its
argument and returns a vector of values or a one-row data
frame. The return values of the function are then fed into
plyr
's ldply
to turn it into a data frame.
See parsePost
for an example.
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.
The function returns either the raw list of retrieved posts or whatever the supplied parsing function does with the retrieved list.
Google+ API documentation: https://developers.google.com/+/api/latest/activities/list.
1 2 3 4 5 | ## Not run:
myPosts.df <- harvestPage("115046504166916768425")
gPosts.df <- harvestPage("+google", results=200)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.