Learn R Programming

Goodreader

Goodreader is a comprehensive toolkit for scraping and analyzing book data from Goodreads.

Installation

From CRAN:

install.packages("Goodreader") 

Use Goodreader

#load the package
library(Goodreader)

#Search for books
AI_df <- search_goodreads(search_term = "artificial intelligence", search_in = "title", num_books = 10, sort_by = "ratings")

#Retrieve Book IDs and save them into a text file
get_book_ids(input_data = AI_df, file_name = "AI_books.txt")

#Get book-related information
scrape_books(book_ids_path = "AI_books.txt")

#Scrape book reviews
scrape_reviews(book_ids_path = "AI_books.txt", num_reviews = 10)

Copy Link

Version

Install

install.packages('Goodreader')

Monthly Downloads

573

Version

0.1.1

License

GPL-3

Maintainer

Chao Liu Liu

Last Published

August 30th, 2024

Functions in Goodreader (0.1.1)

plot_topic_prevalence

Visualize topic prevalence
model_topics

Analyze topics in Goodreads reviews
plot_topic_heatmap

Visualize topic distribution
sentiment_trend

Plot sentiment trend over time
top_terms

Extract and print top terms for each topic
plot_topic_terms

Visualize top terms for each topic
get_rating_distribution

Get Rating Distribution from Goodreads
search_goodreads

Search Goodreads
get_published_time

Get Published Time from Goodreads
sentiment_histogram

Create a histogram of sentiment scores
replace_special_chars

Replace special characters and remove non-ASCII characters
analyze_sentiment

Perform sentiment analysis on book reviews with negation handling
get_book_summary

Get Book Summary from Goodreads
get_genres

Get Genres for Books from Goodreads
get_author_info

Get Author Information from Goodreads
get_book_ids

Save Book IDs to a Text File
get_num_pages

Get Number of Pages from Goodreads
fit_lda

Perform topic modeling on preprocessed reviews
gen_topic_clouds

Create word cloud for topics
get_format_info

Get Format Information from Goodreads
preprocess_reviews

Preprocess review text for topic modeling
scrape_books

Scrape book details from Goodreads
scrape_reviews

Scrape book reviews from Goodreads
average_book_sentiment

Calculate average sentiment score per book