Description Usage Arguments Details Value See Also Examples
This function returns posts and/or comments made by one user. They can be requested for a specific timeframe or sort order.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
user |
The username of the user for which posts and comments are requested. |
accesstoken |
The accesstoken required to access the endpoint. Scope
must be |
type |
The type of content that is requested for the user. Possible valuesare:
|
sort |
The order in which the posts or comments of the user should be ordered when accessing them. Possible values are:
|
time |
The timeframe for the
|
limit |
The maximum number of items to return. Must be a number between 1 and 100. |
before |
The fullname of an item serving as anchor in the request. Items before this item in the listing are returned. |
after |
The fullname of an item serving as anchor in the request. Items after this item in the listing are returned. |
output |
What the function should return. Choose |
verbose |
A logical flag whether information about the data extraction should be printed to the console. |
retry |
A logical flag whether a failed api request should be retried. Requests will be tried up to three times with varying time intervals between requests. |
More info at https://www.reddit.com/dev/api/
Posts, comments or both for the specified user as a dataframe, json object or a list containing both.
get_user_comments
and get_submissions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ## Not run:
history_token <- get_token(scope = "history",
useragent = my_useragent,
username = my_username,
password = my_password,
client_id = my_client_id,
client_secret = my_client_secret)
# overview returns posts and comments
overview <- get_user(user = "_KeanuReeves",
type = "overview",
accesstoken = history_token,
sort = "top", time = "all",
limit = 10)
# type = "comments" returns only comments
user_comments <- get_user(user = "_KeanuReeves",
type = "comments",
accesstoken = history_token,
sort = "top", time = "all",
limit = 10)
# type = "submitted" returns only posts
user_comments <- get_user(user = "_KeanuReeves",
type = "submitted",
accesstoken = history_token,
sort = "top", time = "all",
limit = 10)
#
gilded <- get_user(user = "_KeanuReeves",
type = "gilded",
accesstoken = history_token,
sort = "hot",
time = "all",
limit = 10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.