kindle

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAmazonURL = "https://www.amazon.com"

Variables

View Source
var (
	DefaultClient = &Client{
		client:    req.C().ImpersonateChrome(),
		amazonUrl: utils.CloneURL(defaultAmazonURL),
	}
)

Functions

This section is empty.

Types

type Book

type Book struct {
	ASIN        string
	Format      string
	Title       string
	Author      string
	Cover       string
	PublishDate *time.Time
}

func BookFromHTML

func BookFromHTML(bookNode *html.Node) *Book

BookFromHTML parses a book from the html of a result on the search results page. If a result is not for a book, nil will is returned.

func BooksFromHTML

func BooksFromHTML(searchNode *html.Node) ([]Book, error)

BooksFromHTML parses the books from the html of a search results page.

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(countryCode *string) (*Client, error)

Creates a new kindle client. If country code is nil or unset, amazon.com will be used as the url. Will return an error if the country code is invalid.

func (*Client) Search

func (c *Client) Search(ctx context.Context, title string, author *string) ([]Book, error)

func (*Client) URL

func (c *Client) URL() *url.URL

URL returns a clone of of the amazon url used by the client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址