Skip to contents

Download an individual user's content from reddit

Usage

get_user_comments(
  user_name,
  limit = 10L,
  after = NULL,
  base_url = "https://www.reddit.com/"
)

Arguments

user_name

character string for an individual reddit user

limit

integer value between 1 and 100

after

character string specifying the location in a list of user comments. If specified, the comments after that location are returned (if found).

base_url

base url for the GET request

Value

list containing named items: `data`, `after`, and `request`. `data` is a data frame of reddit comments for a user. `after` is a character value of the hashed location of the last comment included in the returned items. This value can be used as a starting point for the next batch of responses. `request` is the exact string for which results are returned.

Examples

# example code
sprog2 <- get_user_comments(user_name="poem_for_your_sprog", limit=2)
#> Error in get_user_comments(user_name = "poem_for_your_sprog", limit = 2): Error in req_perform(req) : HTTP 403 Forbidden.
sprog_next2 <- get_user_comments(user_name="poem_for_your_sprog", limit=2, after=sprog2$after)
#> Error: object 'sprog2' not found
sprog4 <- get_user_comments(user_name="poem_for_your_sprog", limit=4)
#> Error in get_user_comments(user_name = "poem_for_your_sprog", limit = 4): Error in req_perform(req) : HTTP 403 Forbidden.