scrape_reviews {Goodreader} | R Documentation |
Scrape book reviews from Goodreads
Description
This function scrapes book reviews from Goodreads based on provided book IDs.
Usage
scrape_reviews(
book_ids_path,
num_reviews = 30,
use_parallel = FALSE,
num_cores = 4
)
Arguments
book_ids_path |
A character string specifying the path to a file containing book IDs. |
num_reviews |
An integer specifying the number of reviews to scrape per book. Default is 30. |
use_parallel |
A logical value indicating whether to use parallel processing. Default is FALSE. |
num_cores |
An integer specifying the number of cores to use for parallel processing. Default is 4. |
Value
A data frame containing scraped review information.
Examples
# Create a temporary file with sample book IDs
temp_file <- tempfile(fileext = ".txt")
writeLines(c("1420", "2767052", "10210"), temp_file)
# Run the function (with a small number of reviews to keep the example quick)
reviews <- scrape_reviews(temp_file, num_reviews = 5, use_parallel = FALSE)
print(head(reviews))
# Clean up: remove the temporary file
file.remove(temp_file)
[Package Goodreader version 0.1.2 Index]