get_genres: Get Genres for Books from Goodreads

View source: R/get_genres.R

get_genresR 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)


Goodreader documentation built on Oct. 30, 2024, 9:11 a.m.