https://github.com/cheshire137/gogoamazonwish
A Go library to get items from an Amazon wishlist.
https://github.com/cheshire137/gogoamazonwish
amazon go-library golang wishlist
Last synced: 7 months ago
JSON representation
A Go library to get items from an Amazon wishlist.
- Host: GitHub
- URL: https://github.com/cheshire137/gogoamazonwish
- Owner: cheshire137
- License: mit
- Created: 2019-12-26T21:35:15.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2021-07-06T18:17:21.000Z (over 4 years ago)
- Last Synced: 2025-04-08T02:35:17.104Z (8 months ago)
- Topics: amazon, go-library, golang, wishlist
- Language: Go
- Homepage: https://godoc.org/github.com/cheshire137/gogoamazonwish/pkg/amazon
- Size: 310 KB
- Stars: 12
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# GoGo Amazon Wish

A Go library to get items from an Amazon wishlist. Unofficial as Amazon
shut down their wishlist API. This uses web scraping to get the items
off a specified wishlist.
## How to use
See [the docs](https://godoc.org/github.com/cheshire137/gogoamazonwish/pkg/amazon).
```sh
go get -u github.com/cheshire137/gogoamazonwish/pkg/amazon
```
```go
import (
"fmt"
"log"
"github.com/cheshire137/gogoamazonwish/pkg/amazon"
)
func main() {
url := "https://www.amazon.com/hz/wishlist/ls/3I6EQPZ8OB1DT"
wishlist, err := amazon.NewWishlist(url)
if err != nil {
log.Fatalln(err)
}
items, err := wishlist.Items()
if err != nil {
log.Fatalln(err)
}
fmt.Printf("Found %d item(s):\n\n", len(items))
number := 1
for _itemID, item := range items {
fmt.Printf("%d) %s\n\n", number, item)
number++
}
}
```
## How to develop
I built this with Go version 1.13.4. There's a command-line tool to test
loading an Amazon wishlist that you can run via:
`go run cmd/getwishlist/main.go` _URL to Amazon wishlist_ _[proxy URL]..._
You can specify optional proxy URLs to hit Amazon with. Might be useful if you're
hitting errors about Amazon thinking the tool is a bot.
Sample use:
```sh
go run cmd/getwishlist/main.go "https://www.amazon.com/hz/wishlist/ls/3I6EQPZ8OB1DT"
```
To run tests: `make`
## Thanks
- [Colly web scraper](http://go-colly.org)
- [Increase your scraping speed with Go and Colly! — Advanced Part](https://medium.com/swlh/increase-your-scraping-speed-with-go-and-colly-advanced-part-a38648111ab2)