View source: R/Collect.thread.reddit.R
Collect.thread.reddit | R Documentation |
Collects comments made by users on one or more specified subreddit conversation threads and structures
the data into a dataframe with the class names "datasource"
and "reddit"
.
## S3 method for class 'thread.reddit'
Collect(
credential,
endpoint,
threadUrls,
sort = NA,
waitTime = c(6, 8),
ua = getOption("HTTPUserAgent"),
writeToFile = FALSE,
verbose = FALSE,
...
)
collect_reddit_threads(
threadUrls,
sort = "best",
waitTime = c(6, 8),
ua = vsml_ua(),
writeToFile = FALSE,
verbose = FALSE,
...
)
credential |
A |
endpoint |
API endpoint. |
threadUrls |
Character vector. Reddit thread urls to collect data from. |
sort |
Character vector. Reddit comment sort order. Options are |
waitTime |
Numeric vector. Time range in seconds to select random wait from in-between url collection requests.
Minimum is 3 seconds. Default is |
ua |
Character string. Override User-Agent string to use in Reddit thread requests. Default is
|
writeToFile |
Logical. Write collected data to file. Default is |
verbose |
Logical. Output additional information about the data collection. Default is |
... |
Additional parameters passed to function. Not used in this method. |
A tibble
object with class names "datasource"
and "reddit"
.
The reddit web endpoint used for collection has maximum limit of 500 comments per thread url.
## Not run:
# subreddit url to collect threads from
threadUrls <- c("https://www.reddit.com/r/xxxxxx/comments/xxxxxx/x_xxxx_xxxxxxxxx/")
redditData <- redditAuth |>
Collect(threadUrls = threadUrls, writeToFile = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.