Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 28 days 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 (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-06T18:17:21.000Z (over 3 years ago)
- Last Synced: 2024-11-28T13:43:32.860Z (about 1 month 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: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# GoGo Amazon Wish
![](https://github.com/cheshire137/gogoamazonwish/workflows/.github/workflows/test.yml/badge.svg)
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)