get_genres {Goodreader} | R Documentation |
Get Genres for Books from Goodreads
Description
This function reads book IDs from a file, fetches the corresponding Goodreads pages, and extracts the genres for each book.
Usage
get_genres(file_path)
Arguments
file_path |
A character string specifying the path to the file containing book IDs. |
Value
A named list where each element corresponds to a book ID and contains a character vector of genres for that book.
Examples
# Create a temporary file with sample book IDs
temp_file <- tempfile(fileext = ".txt")
writeLines(c("1420", "2767052", "10210"), temp_file)
# Run the function
genres <- get_genres(temp_file)
# Display the results
print(genres)
# Clean up: remove the temporary file
file.remove(temp_file)
[Package Goodreader version 0.1.2 Index]