get_genres | R Documentation |
This function reads book IDs from a file, fetches the corresponding Goodreads pages, and extracts the genres for each book.
get_genres(file_path)
file_path |
A character string specifying the path to the file containing book IDs. |
A named list where each element corresponds to a book ID and contains a character vector of genres for that book.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.