Add Amazon support (#3)
This commit introduces the Amazon support with calls to the Product Advertising API (PA API). For now, I was only able to use the "www.amazon.fr" marketplace. I will add more marketplaces when my Amazon Associate accounts will be validated. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
f994093baf
commit
5ac5f78ae2
11 changed files with 394 additions and 111 deletions
10
utils.go
10
utils.go
|
|
@ -16,3 +16,13 @@ func ExtractShopName(link string) (name string, err error) {
|
|||
re := regexp.MustCompile(`^www\.`)
|
||||
return strings.ToLower(re.ReplaceAllString(u.Hostname(), "")), nil
|
||||
}
|
||||
|
||||
// ContainsString returns true when string is found in the array of strings
|
||||
func ContainsString(arr []string, str string) bool {
|
||||
for _, elem := range arr {
|
||||
if elem == str {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue