예제 #1
0
파일: amazon.go 프로젝트: cemoulto/s
// BuildURI generates a search URL for Amazon.
func (p *Provider) BuildURI(q string) string {
	switch providers.Region() {
	case "AU":
		return fmt.Sprintf("https://www.amazon.com.au/s/?keywords=%s", url.QueryEscape(q))
	case "BR":
		return fmt.Sprintf("https://www.amazon.com.br/s/?keywords=%s", url.QueryEscape(q))
	case "CA":
		return fmt.Sprintf("https://www.amazon.ca/s/?keywords=%s", url.QueryEscape(q))
	case "DE":
		return fmt.Sprintf("https://www.amazon.de/s/?keywords=%s", url.QueryEscape(q))
	case "ES":
		return fmt.Sprintf("https://www.amazon.es/s/?keywords=%s", url.QueryEscape(q))
	case "FR":
		return fmt.Sprintf("https://www.amazon.fr/s/?keywords=%s", url.QueryEscape(q))
	case "GB":
		return fmt.Sprintf("https://www.amazon.co.uk/s/?keywords=%s", url.QueryEscape(q))
	case "IN":
		return fmt.Sprintf("https://www.amazon.in/s/?keywords=%s", url.QueryEscape(q))
	case "IT":
		return fmt.Sprintf("https://www.amazon.it/s/?keywords=%s", url.QueryEscape(q))
	case "JP":
		return fmt.Sprintf("https://www.amazon.co.jp/s/?keywords=%s", url.QueryEscape(q))
	case "MX":
		return fmt.Sprintf("https://www.amazon.com.mx/s/?keywords=%s", url.QueryEscape(q))
	case "NL":
		return fmt.Sprintf("https://www.amazon.nl/s/?keywords=%s", url.QueryEscape(q))
	default:
		return fmt.Sprintf("https://www.amazon.com/s/?keywords=%s", url.QueryEscape(q))
	}
}
예제 #2
0
파일: amazon.go 프로젝트: KeizerDev/s
// BuildURI generates a search URL for Amazon.
func (p *Provider) BuildURI(q string) string {
	switch providers.Region() {
	case "GB":
		return fmt.Sprintf("https://www.amazon.co.uk/s/?keywords=%s", url.QueryEscape(q))
	default:
		return fmt.Sprintf("https://www.amazon.com/s/?keywords=%s", url.QueryEscape(q))
	}
}