Documentation ¶
Index ¶
- Constants
- type Item
- type Wishlist
- func (w *Wishlist) Errors() []error
- func (w *Wishlist) ID() string
- func (w *Wishlist) Items() (map[string]*Item, error)
- func (w *Wishlist) Name() (string, error)
- func (w *Wishlist) PrintURL() (string, error)
- func (w *Wishlist) SetProxyURLs(urls ...string)
- func (w *Wishlist) String() string
- func (w *Wishlist) URLs() []string
Constants ¶
const ( // DefaultAmazonDomain is the domain where an Amazon wishlist will // be assumed to be located if not otherwise specified. DefaultAmazonDomain = "https://www.amazon.com" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { // IsPrime indicates whether the product is eligible for Amazon Prime free // shipping. IsPrime bool // DirectURL is the URL to view this product on Amazon. DirectURL string // AddToCartURL is the URL to add this product to your shopping cart on Amazon, // tied to the particular wishlist it came from. AddToCartURL string // ImageURL is the URL of an image that represents this product. ImageURL string // ReviewsURL is the URL to view customer reviews of this product. ReviewsURL string // ReviewCount is how many reviews customers have left for this product on Amazon. ReviewCount int // RequestedCount is how many of the product the wishlist recipient would like // to receive. RequestedCount int // OwnedCount is how many of the product the wishlist recipient already owns. OwnedCount int // Name is the name of this product. Name string // Price is a string representation of the cost of this product on Amazon. Price string // ID is a unique identifier for this product on Amazon. ID string // DateAdded is a string representation of when this item was added to the // wishlist. Example: "October 20, 2019" RawDateAdded string // Rating is a string description of how Amazon customers have rated this // product. Rating string }
Item represents a product on an Amazon wishlist.
func NewItem ¶
NewItem constructs an Item with the given product identifier, name, and URL to its Amazon page.
type Wishlist ¶
type Wishlist struct { // DebugMode specifies whether messages should be logged to STDOUT about // what's going on, as well as if the HTML source of the wishlist should // be saved to files. DebugMode bool // CacheResults determines whether responses from Amazon should be cached. CacheResults bool // contains filtered or unexported fields }
Wishlist represents an Amazon wishlist of products.
func NewWishlist ¶
NewWishlist constructs an Amazon wishlist for the given URL.
func NewWishlistFromID ¶
NewWishlistFromID constructs an Amazon wishlist for the given wishlist ID.
func NewWishlistFromIDAtDomain ¶
NewWishlistFromIDAtDomain constructs an Amazon wishlist for the given wishlist ID at the given Amazon domain, e.g., "https://amazon.com".
func (*Wishlist) Items ¶
Items returns a map of the products on the wishlist, where keys are the product IDs and the values are the products.
func (*Wishlist) PrintURL ¶
PrintURL returns the URL to the printer-friendly view of this wishlist on Amazon.
func (*Wishlist) SetProxyURLs ¶
SetProxyURLs specifies URLs of proxies to use when accessing Amazon. May be useful if you're getting an error about Amazon thinking you're a bot.