Documentation
¶
Index ¶
- Constants
- func AddToShelf(b *Browser, bookID string, shelfName string) error
- func ConfigPath() string
- func Login(b *Browser, cfg *Config) error
- func Logout() error
- func MarkCurrentlyReading(b *Browser, bookID string) error
- func MarkRead(b *Browser, bookID string) error
- func PostNewTopic(b *Browser, topicURL string, subject string, message string, bookID string, ...) error
- func PostReply(b *Browser, topicID string, message string, bookID string, authorID string) error
- func SessionPath() string
- type Book
- type Browser
- type Client
- type Config
- type ReadingProgress
- type Shelf
Constants ¶
const BaseURL = "https://www.goodreads.com"
Variables ¶
This section is empty.
Functions ¶
func AddToShelf ¶
AddToShelf navigates to a book page and adds it to the specified shelf.
func ConfigPath ¶
func ConfigPath() string
func MarkCurrentlyReading ¶
MarkCurrentlyReading adds a book to the "currently-reading" shelf.
func PostNewTopic ¶
func PostNewTopic(b *Browser, topicURL string, subject string, message string, bookID string, authorID string) error
PostNewTopic creates a new discussion topic in a Goodreads group. The topicURL should be the full new-topic URL including context_id, context_type, and folder_id.
func SessionPath ¶
func SessionPath() string
Types ¶
type Browser ¶
Browser wraps a rod browser and page for Goodreads interactions.
func NewBrowser ¶
NewBrowser launches a Chrome instance and navigates to goodreads.com. Set headless to false to see the browser for debugging.
func (*Browser) IsLoggedIn ¶
IsLoggedIn checks if the user is logged in by looking for user-specific elements.
func (*Browser) LoadCookies ¶
LoadCookies loads cookies from the session file into the browser.
func (*Browser) SaveCookies ¶
SaveCookies persists browser cookies to the session file.
type Client ¶
Client is a plain HTTP client for operations that don't need a browser (e.g. search).