Learn R Programming

rtweet (version 1.2.1)

user_bookmarks: Retrieve user bookmarks

Description

Collects the 800 most recent bookmarked tweets of a user.

Usage

user_bookmarks(
  id,
  n = 100,
  ...,
  expansions = NULL,
  fields = NULL,
  parse = TRUE,
  token = NULL,
  verbose = FALSE
)

Value

A data.frame with the user information of who is following the list: edit_history_tweet_ids, id and text. Other information depends on the expansions and fields requested. Accepted values are:

  • Expansions: set_expansions(list = NULL).

  • Fields: set_fields(list = NULL).

Arguments

id

Twitter user id: character string identifying your account.

n

Number of tweets to retrieve.

...

Other arguments passed down to the API.

expansions

Set NULL to not use any expansion, set NA to get all expansions, or provide a vector with the expansions you want (create it with set_expansions()).

fields

Set NULL to not use any field, get all allowed fields with NA, provide a list with the fields you want (create it with set_fields()).

parse

If TRUE, the default, returns a tidy data frame. Use FALSE to return the "raw" list corresponding to the JSON returned from the Twitter API.

token

This endpoint only accept a OAuth2.0 authentication (can be created via rtweet_oauth2()).

verbose

A logical value

References

https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/get-users-id-bookmarks

See Also

rtweet_oauth2(), user_self()

Examples

Run this code
if (FALSE) {
   # Requires token_oa2
   ub <- user_bookmarks(user_self()$id, parse = FALSE, n = Inf, token = token_oa2)
}

Run the code above in your browser using DataLab