R/Collect.listing.reddit.R
, R/wrappers.R
Collect.listing.reddit.Rd
Collects thread listings for one or more specified subreddits and structures the data into a dataframe.
# S3 method for listing.reddit
Collect(
credential,
endpoint,
subreddits,
sort = "hot",
period = "all",
max = 25,
waitTime = c(6, 8),
ua = getOption("HTTPUserAgent"),
writeToFile = FALSE,
verbose = FALSE,
...
)
collect_reddit_listings(
subreddits,
sort = "new",
period = NULL,
max = 25,
waitTime = c(6, 8),
ua = vsml_ua(),
writeToFile = FALSE,
verbose = FALSE,
...
)
A credential
object generated from Authenticate
with class name "reddit"
.
API endpoint.
Character vector. Subreddit names to collect thread listings from.
Character vector. Listing thread sort order. Options are "hot"
, "top"
, "new"
, and
"rising"
. Default is "hot"
.
Character vector. Listing top threads by time period. Only applicable to sort order by "top"
.
Options are "hour"
, "day"
, "week"
, "month"
, "year"
and "all"
. Default is
"all"
.
Numeric vector. Maximum number of threads in listing to return. Default is 25
.
Numeric vector. Time range in seconds to select random wait from in-between url collection requests.
Minimum is 3 seconds. Default is c(6, 8)
for a wait time chosen from between 6 and 8 seconds.
Character string. Override User-Agent string to use in Reddit thread requests. Default is
option("HTTPUserAgent")
value as set by vosonSML.
Logical. Write collected data to file. Default is FALSE
.
Logical. Output additional information about the data collection. Default is TRUE
.
Additional parameters passed to function. Not used in this method.
A tibble
object with class names "listing"
and "reddit"
.
The reddit endpoint used for collection has maximum limit of 25 per listing.